@qoretechnologies/reqore 0.78.24 → 0.78.25-pr.715.g0cfacc5
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/dist/components/Accordion/index.d.ts.map +1 -1
- package/dist/components/Accordion/index.js +28 -19
- package/dist/components/Accordion/index.js.map +1 -1
- package/dist/components/Bubble/index.d.ts.map +1 -1
- package/dist/components/Bubble/index.js +3 -2
- package/dist/components/Bubble/index.js.map +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +58 -21
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Callout/index.d.ts.map +1 -1
- package/dist/components/Callout/index.js +25 -12
- 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 +42 -19
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/CollapsibleContent/index.d.ts +12 -0
- package/dist/components/CollapsibleContent/index.d.ts.map +1 -1
- package/dist/components/CollapsibleContent/index.js +37 -16
- package/dist/components/CollapsibleContent/index.js.map +1 -1
- package/dist/components/Collection/index.d.ts +8 -1
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +34 -21
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/Collection/item.js +1 -1
- package/dist/components/Collection/item.js.map +1 -1
- package/dist/components/DataView/index.d.ts +11 -0
- package/dist/components/DataView/index.d.ts.map +1 -1
- package/dist/components/DataView/index.js +40 -22
- package/dist/components/DataView/index.js.map +1 -1
- package/dist/components/DatePicker/index.d.ts +6 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +12 -10
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DescriptionList/index.d.ts +7 -0
- package/dist/components/DescriptionList/index.d.ts.map +1 -1
- package/dist/components/DescriptionList/index.js +6 -2
- 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 +3 -1
- package/dist/components/Drawer/backdrop.js.map +1 -1
- package/dist/components/Drawer/index.d.ts +17 -0
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +70 -15
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Dropdown/index.d.ts +11 -0
- package/dist/components/Dropdown/index.d.ts.map +1 -1
- package/dist/components/Dropdown/index.js +10 -3
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/Dropdown/item.js +1 -1
- package/dist/components/Dropdown/item.js.map +1 -1
- package/dist/components/Dropdown/list.d.ts +9 -2
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Dropdown/list.js +29 -13
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Effect/index.d.ts +6 -0
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js +26 -21
- package/dist/components/Effect/index.js.map +1 -1
- package/dist/components/EntityRow/index.d.ts.map +1 -1
- package/dist/components/EntityRow/index.js +3 -3
- package/dist/components/EntityRow/index.js.map +1 -1
- package/dist/components/FeatureCard/index.d.ts.map +1 -1
- package/dist/components/FeatureCard/index.js +10 -5
- 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 +11 -3
- 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 +10 -5
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +6 -5
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InternalPopover/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.js +69 -9
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/KeyboardShortcut/index.d.ts.map +1 -1
- package/dist/components/KeyboardShortcut/index.js +3 -2
- package/dist/components/KeyboardShortcut/index.js.map +1 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +6 -2
- 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 +10 -5
- package/dist/components/Link/index.js.map +1 -1
- package/dist/components/MarkdownBlock/index.d.ts +38 -0
- package/dist/components/MarkdownBlock/index.d.ts.map +1 -0
- package/dist/components/MarkdownBlock/index.js +91 -0
- package/dist/components/MarkdownBlock/index.js.map +1 -0
- package/dist/components/Menu/divider.d.ts.map +1 -1
- package/dist/components/Menu/divider.js +4 -1
- package/dist/components/Menu/divider.js.map +1 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Message/index.js +9 -1
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/Modal/index.d.ts +24 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index.js +5 -34
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/NavRail/index.d.ts.map +1 -1
- package/dist/components/NavRail/index.js +5 -3
- package/dist/components/NavRail/index.js.map +1 -1
- package/dist/components/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +3 -2
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Notifications/styles.d.ts +2 -0
- package/dist/components/Notifications/styles.d.ts.map +1 -1
- package/dist/components/Notifications/styles.js +65 -24
- package/dist/components/Notifications/styles.js.map +1 -1
- package/dist/components/Panel/TitleAndBadges.d.ts +31 -0
- package/dist/components/Panel/TitleAndBadges.d.ts.map +1 -0
- package/dist/components/Panel/TitleAndBadges.js +81 -0
- package/dist/components/Panel/TitleAndBadges.js.map +1 -0
- package/dist/components/Panel/index.d.ts +37 -0
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +250 -97
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Paragraph/index.d.ts.map +1 -1
- package/dist/components/Paragraph/index.js +3 -3
- package/dist/components/Paragraph/index.js.map +1 -1
- package/dist/components/Progress/index.d.ts.map +1 -1
- package/dist/components/Progress/index.js +11 -4
- 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 +1 -1
- package/dist/components/Rating/index.js.map +1 -1
- package/dist/components/SegmentedControl/index.d.ts +24 -1
- package/dist/components/SegmentedControl/index.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index.js +136 -59
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/Select/valuePreview.js +5 -2
- package/dist/components/Select/valuePreview.js.map +1 -1
- package/dist/components/SeverityRow/index.d.ts +12 -4
- package/dist/components/SeverityRow/index.d.ts.map +1 -1
- package/dist/components/SeverityRow/index.js +37 -15
- package/dist/components/SeverityRow/index.js.map +1 -1
- package/dist/components/Spacer/index.js +1 -1
- 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 +3 -3
- 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 +8 -2
- package/dist/components/StackedBar/index.js.map +1 -1
- package/dist/components/Statistic/index.d.ts +16 -1
- package/dist/components/Statistic/index.d.ts.map +1 -1
- package/dist/components/Statistic/index.js +7 -5
- package/dist/components/Statistic/index.js.map +1 -1
- package/dist/components/StatisticGroup/index.d.ts +68 -0
- package/dist/components/StatisticGroup/index.d.ts.map +1 -0
- package/dist/components/StatisticGroup/index.js +123 -0
- package/dist/components/StatisticGroup/index.js.map +1 -0
- package/dist/components/Table/body.d.ts.map +1 -1
- package/dist/components/Table/body.js +36 -4
- 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 +42 -22
- package/dist/components/Table/cell.js.map +1 -1
- package/dist/components/Table/controls.d.ts +70 -0
- package/dist/components/Table/controls.d.ts.map +1 -0
- package/dist/components/Table/controls.js +137 -0
- package/dist/components/Table/controls.js.map +1 -0
- package/dist/components/Table/header.d.ts +10 -1
- package/dist/components/Table/header.d.ts.map +1 -1
- package/dist/components/Table/header.js +5 -5
- package/dist/components/Table/header.js.map +1 -1
- package/dist/components/Table/headerCell.d.ts +10 -1
- package/dist/components/Table/headerCell.d.ts.map +1 -1
- package/dist/components/Table/headerCell.js +37 -24
- package/dist/components/Table/headerCell.js.map +1 -1
- package/dist/components/Table/helpers.d.ts +36 -3
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +79 -8
- package/dist/components/Table/helpers.js.map +1 -1
- package/dist/components/Table/index.d.ts +67 -1
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +116 -83
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/row.d.ts +5 -1
- package/dist/components/Table/row.d.ts.map +1 -1
- package/dist/components/Table/row.js +30 -7
- package/dist/components/Table/row.js.map +1 -1
- package/dist/components/Tabs/index.d.ts +5 -0
- package/dist/components/Tabs/index.d.ts.map +1 -1
- 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 -3
- package/dist/components/Tabs/item.js.map +1 -1
- package/dist/components/Tabs/list.d.ts +7 -2
- package/dist/components/Tabs/list.d.ts.map +1 -1
- package/dist/components/Tabs/list.js +28 -16
- package/dist/components/Tabs/list.js.map +1 -1
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +8 -7
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Testimonial/index.d.ts.map +1 -1
- package/dist/components/Testimonial/index.js +10 -5
- package/dist/components/Testimonial/index.js.map +1 -1
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +6 -5
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/components/Tier/index.d.ts +7 -1
- package/dist/components/Tier/index.d.ts.map +1 -1
- package/dist/components/Tier/index.js +10 -9
- package/dist/components/Tier/index.js.map +1 -1
- package/dist/components/Timeline/index.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +4 -3
- package/dist/components/Timeline/index.js.map +1 -1
- package/dist/components/Tree/index.d.ts +18 -1
- package/dist/components/Tree/index.d.ts.map +1 -1
- package/dist/components/Tree/index.js +36 -25
- 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 +8 -4
- package/dist/components/Tree/modal.js.map +1 -1
- package/dist/constants/sizes.d.ts +26 -0
- package/dist/constants/sizes.d.ts.map +1 -1
- package/dist/constants/sizes.js +33 -1
- package/dist/constants/sizes.js.map +1 -1
- package/dist/constants/theme.d.ts +136 -0
- package/dist/constants/theme.d.ts.map +1 -1
- package/dist/constants/theme.js.map +1 -1
- package/dist/containers/ReqoreProvider.d.ts +23 -0
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/ReqoreProvider.js +52 -12
- package/dist/containers/ReqoreProvider.js.map +1 -1
- package/dist/containers/UIProvider.d.ts +4 -1
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +6 -2
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/context/ReqoreContext.d.ts +16 -0
- package/dist/context/ReqoreContext.d.ts.map +1 -1
- package/dist/context/ReqoreContext.js +3 -0
- package/dist/context/ReqoreContext.js.map +1 -1
- package/dist/helpers/colors.d.ts +33 -2
- package/dist/helpers/colors.d.ts.map +1 -1
- package/dist/helpers/colors.js +65 -3
- package/dist/helpers/colors.js.map +1 -1
- package/dist/helpers/typeScale.d.ts +30 -0
- package/dist/helpers/typeScale.d.ts.map +1 -0
- package/dist/helpers/typeScale.js +34 -0
- package/dist/helpers/typeScale.js.map +1 -0
- package/dist/helpers/utils.d.ts +5 -1
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/helpers/utils.js +5 -2
- package/dist/helpers/utils.js.map +1 -1
- package/dist/hooks/useColorDataByType.d.ts +6 -0
- package/dist/hooks/useColorDataByType.d.ts.map +1 -0
- package/dist/hooks/useColorDataByType.js +11 -0
- package/dist/hooks/useColorDataByType.js.map +1 -0
- package/dist/hooks/useFocusTrap.d.ts +12 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +50 -7
- package/dist/hooks/useFocusTrap.js.map +1 -1
- package/dist/hooks/useReqoreEscClose.d.ts +20 -0
- package/dist/hooks/useReqoreEscClose.d.ts.map +1 -0
- package/dist/hooks/useReqoreEscClose.js +44 -0
- package/dist/hooks/useReqoreEscClose.js.map +1 -0
- package/dist/hooks/useUppercaseLabels.d.ts +8 -0
- package/dist/hooks/useUppercaseLabels.d.ts.map +1 -0
- package/dist/hooks/useUppercaseLabels.js +13 -0
- package/dist/hooks/useUppercaseLabels.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/docs/docs/guides/theming.mdx +15 -0
- package/package.json +1 -1
- package/tests.json +0 -1
|
@@ -71,7 +71,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
71
71
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
72
72
|
};
|
|
73
73
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
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 = exports.STICKY_HEADER_TALL_SCREENS = void 0;
|
|
75
75
|
var react_1 = require("react");
|
|
76
76
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
77
77
|
var classnames_1 = __importDefault(require("classnames"));
|
|
@@ -85,6 +85,7 @@ var responsive_1 = require("./responsive");
|
|
|
85
85
|
var styled_components_1 = require("styled-components");
|
|
86
86
|
var colors_1 = require("../../constants/colors");
|
|
87
87
|
var sizes_1 = require("../../constants/sizes");
|
|
88
|
+
var typeScale_1 = require("../../helpers/typeScale");
|
|
88
89
|
var colors_2 = require("../../helpers/colors");
|
|
89
90
|
var styled_1 = __importStar(require("../../helpers/styled"));
|
|
90
91
|
var utils_1 = require("../../helpers/utils");
|
|
@@ -107,6 +108,7 @@ var Span_1 = require("../Span");
|
|
|
107
108
|
var TooltipComponent_1 = require("../TooltipComponent");
|
|
108
109
|
var LabelEditor_1 = require("./LabelEditor");
|
|
109
110
|
var NonResponsiveActions_1 = require("./NonResponsiveActions");
|
|
111
|
+
var TitleAndBadges_1 = require("./TitleAndBadges");
|
|
110
112
|
var getPaddingSize = function (padded, size) {
|
|
111
113
|
return typeof padded === 'string' ? sizes_1.SPECIAL_PADDING_FROM_SIZE[padded] : sizes_1.PADDING_FROM_SIZE[size];
|
|
112
114
|
};
|
|
@@ -131,6 +133,25 @@ var getScrollableAncestor = function (node) {
|
|
|
131
133
|
}
|
|
132
134
|
return null;
|
|
133
135
|
};
|
|
136
|
+
/**
|
|
137
|
+
* How many screens of its scroll area a panel must span before a `stickyHeader` pins.
|
|
138
|
+
*
|
|
139
|
+
* A pinned header is for finding your place in a long panel whose header has scrolled away. A
|
|
140
|
+
* panel that fits on the screen, or nearly does, never puts you there: its header pinned for
|
|
141
|
+
* the few pixels it overhung and drew a band with nothing under it to label (Filip,
|
|
142
|
+
* 2026-11-16: "it looks really dumb"). Just over one screen is not enough - a 311px card in a
|
|
143
|
+
* 264px area pinned for its 47px of overhang - so the line is one and a half. The rule is
|
|
144
|
+
* shared by every Qore app (instruction-files decision 028).
|
|
145
|
+
*/
|
|
146
|
+
exports.STICKY_HEADER_TALL_SCREENS = 1.5;
|
|
147
|
+
/** The height a scroll area shows: its client height less its own padding, or the window's
|
|
148
|
+
* for the viewport. */
|
|
149
|
+
var getScrollportVisibleHeight = function (el) {
|
|
150
|
+
if (!el)
|
|
151
|
+
return window.innerHeight;
|
|
152
|
+
var style = getComputedStyle(el);
|
|
153
|
+
return (el.clientHeight - (parseFloat(style.paddingTop) || 0) - (parseFloat(style.paddingBottom) || 0));
|
|
154
|
+
};
|
|
134
155
|
/** The distance from a scrollport's border-box top to the line a `position:
|
|
135
156
|
* sticky; top: 0` descendant actually pins to — its top padding. Sticky
|
|
136
157
|
* resolves against the scroll container's CONTENT box, so a padded scrollport
|
|
@@ -155,7 +176,10 @@ var getScrollportInset = function (el) {
|
|
|
155
176
|
* opening a line box around the inline-flex heading — a block wrapper adds the row's leading on
|
|
156
177
|
* top of the heading's own box, which made a `tiny` panel 3px taller than it used to be.
|
|
157
178
|
*/
|
|
158
|
-
var StyledPanelTitleLabelBox = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n min-width: 0;\n overflow: hidden;\n flex:
|
|
179
|
+
var StyledPanelTitleLabelBox = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n min-width: 0;\n overflow: hidden;\n /* A title shrunk below its natural size takes its line whole, so its badges stay under it: it\n shrank because it did not fit the line on its own, and a smaller font must not make room for\n them beside it again. Badges give way before the title gives anything. */\n flex: ", ";\n\n ", "\n"], ["\n display: flex;\n min-width: 0;\n overflow: hidden;\n /* A title shrunk below its natural size takes its line whole, so its badges stay under it: it\n shrank because it did not fit the line on its own, and a smaller font must not make room for\n them beside it again. Badges give way before the title gives anything. */\n flex: ", ";\n\n ", "\n"])), function (_a) {
|
|
180
|
+
var $ownLine = _a.$ownLine;
|
|
181
|
+
return ($ownLine ? '1 1 100%' : '0 1 auto');
|
|
182
|
+
}, function (_a) {
|
|
159
183
|
var $clampLines = _a.$clampLines;
|
|
160
184
|
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);
|
|
161
185
|
});
|
|
@@ -210,7 +234,7 @@ exports.StyledPanelTitleHeaderContent = styled_1.default.div(templateObject_9 ||
|
|
|
210
234
|
return width;
|
|
211
235
|
});
|
|
212
236
|
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"])));
|
|
213
|
-
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"])));
|
|
237
|
+
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 /* A title and its count read as one line: the count sits on the title's baseline. Centred in\n the row instead, a count smaller than its title floated above it, like a superscript,\n because the title's text sits low in the taller heading box it is set in. The icon stays\n centred. */\n & > .", " {\n align-self: baseline;\n }\n"], ["\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n\n /* A title and its count read as one line: the count sits on the title's baseline. Centred in\n the row instead, a count smaller than its title floated above it, like a superscript,\n because the title's text sits low in the taller heading box it is set in. The icon stays\n centred. */\n & > .", " {\n align-self: baseline;\n }\n"])), TitleAndBadges_1.TITLE_AND_BADGES_CLASS);
|
|
214
238
|
/**
|
|
215
239
|
* Does the panel wrapper draw its 1px border?
|
|
216
240
|
*
|
|
@@ -233,6 +257,31 @@ var getPanelBorderBaseColor = function (theme, _a) {
|
|
|
233
257
|
var intent = _a.intent, accentPosition = _a.accentPosition;
|
|
234
258
|
return (intent && !accentPosition ? theme.intents[intent] : (0, colors_2.getMainBackgroundColor)(theme));
|
|
235
259
|
};
|
|
260
|
+
/** The title bar: a band a step lighter than the page — or, with `theme.panel` named, the
|
|
261
|
+
* panel's own surface, set apart from the body by the hairline under it alone. */
|
|
262
|
+
var getPanelHeaderColor = function (theme, hovered) {
|
|
263
|
+
var themed = (0, colors_2.getThemePanelSurface)(theme);
|
|
264
|
+
if (themed === null || themed === void 0 ? void 0 : themed.main) {
|
|
265
|
+
return hovered ? (0, colors_2.changeLightness)(themed.main, 0.02) : themed.main;
|
|
266
|
+
}
|
|
267
|
+
return (0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), hovered ? 0.05 : 0.03);
|
|
268
|
+
};
|
|
269
|
+
/** The resting border: the intent's colour when the intent tints the edge, else the hairline
|
|
270
|
+
* (`theme.panel.border` when the theme names one). */
|
|
271
|
+
var getPanelBorderColor = function (theme, _a) {
|
|
272
|
+
var intent = _a.intent, accentPosition = _a.accentPosition;
|
|
273
|
+
return intent && !accentPosition
|
|
274
|
+
? (0, colors_2.changeLightness)(getPanelBorderBaseColor(theme, { intent: intent, accentPosition: accentPosition }), 0.08)
|
|
275
|
+
: (0, colors_2.getPanelHairlineColor)(theme);
|
|
276
|
+
};
|
|
277
|
+
/** The border while the panel is hovered — a step brighter than at rest. */
|
|
278
|
+
var getPanelHoverBorderColor = function (theme, _a) {
|
|
279
|
+
var intent = _a.intent, accentPosition = _a.accentPosition;
|
|
280
|
+
var themed = !(intent && !accentPosition) ? (0, colors_2.getThemePanelSurface)(theme) : undefined;
|
|
281
|
+
return (themed === null || themed === void 0 ? void 0 : themed.border)
|
|
282
|
+
? (0, colors_2.changeLightness)(themed.border, 0.12)
|
|
283
|
+
: (0, colors_2.changeLightness)(getPanelBorderBaseColor(theme, { intent: intent, accentPosition: accentPosition }), 0.25);
|
|
284
|
+
};
|
|
236
285
|
/**
|
|
237
286
|
* Every panel prop that only styles or configures the panel. None of them reaches the rendered
|
|
238
287
|
* element — the `div`, re-resizable's `Resizable` (which spreads every prop it does not know onto
|
|
@@ -265,9 +314,11 @@ exports.REQORE_PANEL_STYLE_PROPS = (0, styled_1.listReqoreStyleProps)({
|
|
|
265
314
|
description: true,
|
|
266
315
|
descriptionEffect: true,
|
|
267
316
|
descriptionIntent: true,
|
|
317
|
+
descriptionMaxHeight: true,
|
|
268
318
|
descriptionMaxLines: true,
|
|
269
319
|
descriptionPosition: true,
|
|
270
320
|
disabled: true,
|
|
321
|
+
enclosingRadius: true,
|
|
271
322
|
errorBoundaryOptions: true,
|
|
272
323
|
expandTooltip: true,
|
|
273
324
|
fill: true,
|
|
@@ -332,14 +383,14 @@ exports.StyledPanel = (0, styled_1.default)(Effect_1.StyledEffect).withConfig({
|
|
|
332
383
|
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)),
|
|
333
384
|
})(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) {
|
|
334
385
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
335
|
-
return (0, polished_1.rgba)((0, colors_2.
|
|
386
|
+
return (0, polished_1.rgba)((0, colors_2.getPanelBackgroundColor)(theme), opacity);
|
|
336
387
|
}, function (_a) {
|
|
337
|
-
var rounded = _a.rounded, radiusSize = _a.radiusSize;
|
|
338
|
-
return rounded ? (0, sizes_1.
|
|
388
|
+
var rounded = _a.rounded, radiusSize = _a.radiusSize, theme = _a.theme;
|
|
389
|
+
return rounded ? (0, sizes_1.resolvePanelRadius)(theme, radiusSize) : 0;
|
|
339
390
|
}, function (_a) {
|
|
340
391
|
var theme = _a.theme, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition;
|
|
341
392
|
return hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition })
|
|
342
|
-
? "1px solid ".concat((
|
|
393
|
+
? "1px solid ".concat(getPanelBorderColor(theme, { intent: intent, accentPosition: accentPosition }))
|
|
343
394
|
: undefined;
|
|
344
395
|
}, function (_a) {
|
|
345
396
|
var theme = _a.theme;
|
|
@@ -362,7 +413,7 @@ exports.StyledPanel = (0, styled_1.default)(Effect_1.StyledEffect).withConfig({
|
|
|
362
413
|
// The strip sits in the padding box, inside any border, so inset by the border width to
|
|
363
414
|
// land on the wrapper's INNER curve — the same adjustment StyledPanelTopBar makes.
|
|
364
415
|
var stripRadius = stickyHeader && rounded
|
|
365
|
-
? Math.max(0, (0, sizes_1.
|
|
416
|
+
? Math.max(0, (0, sizes_1.resolvePanelRadius)(theme, radiusSize) -
|
|
366
417
|
(hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition }) ? 1 : 0))
|
|
367
418
|
: 0;
|
|
368
419
|
return (0, styled_components_1.css)(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n position: relative;\n /* Reserve the strip's thickness so the title bar and content never sit\n under it \u2014 the same reservation ReqoreCallout makes. */\n padding-", ": ", "px;\n\n &::before {\n content: '';\n position: absolute;\n ", "\n ", "\n background-color: ", ";\n }\n "], ["\n position: relative;\n /* Reserve the strip's thickness so the title bar and content never sit\n under it \u2014 the same reservation ReqoreCallout makes. */\n padding-", ": ", "px;\n\n &::before {\n content: '';\n position: absolute;\n ", "\n ", "\n background-color: ", ";\n }\n "])), accentPosition === 'left' ? 'left' : 'top', $accentSize, accentPosition === 'left'
|
|
@@ -387,9 +438,9 @@ exports.StyledPanel = (0, styled_1.default)(Effect_1.StyledEffect).withConfig({
|
|
|
387
438
|
return interactive
|
|
388
439
|
? (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
|
|
389
440
|
? undefined
|
|
390
|
-
: (0, polished_1.rgba)((0, polished_1.darken)(0.025, (0, polished_1.rgba)((0, colors_2.
|
|
391
|
-
? (
|
|
392
|
-
: 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, polished_1.rgba)((0, polished_1.darken)(0.025, (0, polished_1.rgba)((0, colors_2.
|
|
441
|
+
: (0, polished_1.rgba)((0, polished_1.darken)(0.025, (0, polished_1.rgba)((0, colors_2.getPanelBackgroundColor)(theme), opacity)), opacity), hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition })
|
|
442
|
+
? getPanelHoverBorderColor(theme, { intent: intent, accentPosition: accentPosition })
|
|
443
|
+
: 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, polished_1.rgba)((0, polished_1.darken)(0.025, (0, polished_1.rgba)((0, colors_2.getPanelBackgroundColor)(theme), opacity)), opacity))) : undefined;
|
|
393
444
|
}, function (_a) {
|
|
394
445
|
var raised = _a.raised, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition;
|
|
395
446
|
return raised && !hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition }) && styles_1.RaisedElement;
|
|
@@ -401,39 +452,55 @@ exports.StyledPanel = (0, styled_1.default)(Effect_1.StyledEffect).withConfig({
|
|
|
401
452
|
var disabled = _a.disabled;
|
|
402
453
|
return disabled && styles_1.DisabledElement;
|
|
403
454
|
});
|
|
455
|
+
/**
|
|
456
|
+
* The bottom corners of a collapsed panel's title: the panel's inner radius (inset 1px past a
|
|
457
|
+
* visible border, as the top corners are), so the title alone keeps the card's shape. Only
|
|
458
|
+
* where the header is sticky and rounded — elsewhere the panel clips its title itself — and
|
|
459
|
+
* not while the header is stuck, when it is a full-width bar.
|
|
460
|
+
*/
|
|
461
|
+
var collapsedTitleRadius = function (_a) {
|
|
462
|
+
var isCollapsed = _a.isCollapsed, stickyHeader = _a.stickyHeader, rounded = _a.rounded, radiusSize = _a.radiusSize, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition, isStuck = _a.isStuck, theme = _a.theme;
|
|
463
|
+
return isCollapsed && stickyHeader && rounded && !isStuck
|
|
464
|
+
? "".concat(Math.max(0, (0, sizes_1.resolvePanelRadius)(theme, radiusSize) -
|
|
465
|
+
(hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition }) ? 1 : 0)), "px")
|
|
466
|
+
: undefined;
|
|
467
|
+
};
|
|
404
468
|
exports.StyledPanelTitle = styled_1.default.div.withConfig({
|
|
405
469
|
shouldForwardProp: (0, styled_1.omitStyleProps)('opacity'),
|
|
406
|
-
})(
|
|
470
|
+
})(templateObject_26 || (templateObject_26 = __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 ", "\n\n background-color: ", ";\n justify-content: space-between;\n\n /* The sides clear the panel's corner: a title (or a bottom action) starts at least the\n corner's radius in from the panel's edge, however small the size's own padding is. */\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 ", "\n\n background-color: ", ";\n justify-content: space-between;\n\n /* The sides clear the panel's corner: a title (or a bottom action) starts at least the\n corner's radius in from the panel's edge, however small the size's own padding is. */\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) {
|
|
407
471
|
var $descriptionBelow = _a.$descriptionBelow;
|
|
408
472
|
return ($descriptionBelow ? 'row wrap' : 'row');
|
|
409
473
|
}, function (_a) {
|
|
410
474
|
var $descriptionFontPx = _a.$descriptionFontPx;
|
|
411
|
-
return !!$descriptionFontPx && (0, styled_components_1.css)(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n /* The description is a fixed px from `
|
|
475
|
+
return !!$descriptionFontPx && (0, styled_components_1.css)(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n /* The description is a fixed px from the type scale (`getTextSize`) and knows nothing\n about the title having shrunk, so a fitted title crosses under it: at the 12px floor\n the support text renders at 15px and outranks the heading it supports. Scaling it by\n the SAME factor the title took keeps the two in their original proportion instead of\n giving the description a fit of its own \u2014 which would size it against its own box and\n let the pair drift apart again, in the other direction. */\n .reqore-panel-title-description {\n font-size: ", "px;\n }\n "], ["\n /* The description is a fixed px from the type scale (\\`getTextSize\\`) and knows nothing\n about the title having shrunk, so a fitted title crosses under it: at the 12px floor\n the support text renders at 15px and outranks the heading it supports. Scaling it by\n the SAME factor the title took keeps the two in their original proportion instead of\n giving the description a fit of its own \u2014 which would size it against its own box and\n let the pair drift apart again, in the other direction. */\n .reqore-panel-title-description {\n font-size: ", "px;\n }\n "])), $descriptionFontPx);
|
|
412
476
|
}, function (_a) {
|
|
413
477
|
var $descriptionBelow = _a.$descriptionBelow;
|
|
414
478
|
return $descriptionBelow && (0, styled_components_1.css)(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n /* Only on a wrapping bar. The header claims the row so the action group beside it gets\n squeezed and folds \u2014 that is what the base rule is for \u2014 but in a WRAPPING row a\n full-width claim takes the whole line and pushes the actions onto their own, which is\n not what \"description below\" asked for. Here the header grows from 0 into whatever the\n actions leave, on line one, and the description takes line two. */\n > .reqore-panel-title-header {\n width: auto;\n flex: 1 1 0%;\n min-width: 0;\n }\n "], ["\n /* Only on a wrapping bar. The header claims the row so the action group beside it gets\n squeezed and folds \u2014 that is what the base rule is for \u2014 but in a WRAPPING row a\n full-width claim takes the whole line and pushes the actions onto their own, which is\n not what \"description below\" asked for. Here the header grows from 0 into whatever the\n actions leave, on line one, and the description takes line two. */\n > .reqore-panel-title-header {\n width: auto;\n flex: 1 1 0%;\n min-width: 0;\n }\n "])));
|
|
479
|
+
}, function (_a) {
|
|
480
|
+
var $descriptionMaxHeight = _a.$descriptionMaxHeight;
|
|
481
|
+
return !!$descriptionMaxHeight && (0, styled_components_1.css)(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n /* The whole message, wrapped, scrolling in its own box only past this height \u2014 so a\n dialog's title and its buttons stay on screen whatever it has to say. */\n .reqore-panel-title-description {\n display: block;\n max-height: ", ";\n overflow-y: auto;\n overscroll-behavior: contain;\n white-space: normal;\n overflow-wrap: anywhere;\n }\n "], ["\n /* The whole message, wrapped, scrolling in its own box only past this height \u2014 so a\n dialog's title and its buttons stay on screen whatever it has to say. */\n .reqore-panel-title-description {\n display: block;\n max-height: ", ";\n overflow-y: auto;\n overscroll-behavior: contain;\n white-space: normal;\n overflow-wrap: anywhere;\n }\n "])), $descriptionMaxHeight);
|
|
415
482
|
}, function (_a) {
|
|
416
483
|
var $descriptionMaxLines = _a.$descriptionMaxLines;
|
|
417
|
-
return !!$descriptionMaxLines && (0, styled_components_1.css)(
|
|
484
|
+
return !!$descriptionMaxLines && (0, styled_components_1.css)(templateObject_24 || (templateObject_24 = __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);
|
|
418
485
|
}, function (_a) {
|
|
419
486
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
420
|
-
return (0, polished_1.rgba)((
|
|
487
|
+
return (0, polished_1.rgba)(getPanelHeaderColor(theme), opacity);
|
|
421
488
|
}, function (_a) {
|
|
422
|
-
var noHorizontalPadding = _a.noHorizontalPadding, size = _a.size, padded = _a.padded, opacity = _a.opacity, flat = _a.flat, intent = _a.intent;
|
|
423
|
-
return "".concat(opacity === 0 && flat && !intent ? 0 : getPaddingSize(padded, size), "px ").concat(noHorizontalPadding ? 0 : "".concat(getPaddingSize(padded, size), "px"));
|
|
489
|
+
var noHorizontalPadding = _a.noHorizontalPadding, size = _a.size, padded = _a.padded, opacity = _a.opacity, flat = _a.flat, intent = _a.intent, _b = _a.$cornerInset, $cornerInset = _b === void 0 ? 0 : _b;
|
|
490
|
+
return "".concat(opacity === 0 && flat && !intent ? 0 : getPaddingSize(padded, size), "px ").concat(noHorizontalPadding ? 0 : "".concat((0, sizes_1.clearCorner)(getPaddingSize(padded, size), $cornerInset), "px"));
|
|
424
491
|
}, function (_a) {
|
|
425
492
|
var theme = _a.theme, isCollapsed = _a.isCollapsed, flat = _a.flat, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
426
493
|
return !isCollapsed && !flat && opacity
|
|
427
|
-
? "1px solid ".concat((0, polished_1.rgba)((0, colors_2.
|
|
494
|
+
? "1px solid ".concat((0, polished_1.rgba)((0, colors_2.getPanelHairlineColor)(theme), opacity))
|
|
428
495
|
: null;
|
|
429
496
|
}, sizes_1.GAP_FROM_SIZE.normal, exports.StyledPanelTitleHeaderContent, styles_1.INACTIVE_ICON_SCALE, function (_a) {
|
|
430
497
|
var collapsible = _a.collapsible;
|
|
431
|
-
return collapsible && (0, styled_components_1.css)(
|
|
498
|
+
return collapsible && (0, styled_components_1.css)(templateObject_25 || (templateObject_25 = __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) {
|
|
432
499
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
433
|
-
return (0, polished_1.rgba)((
|
|
500
|
+
return (0, polished_1.rgba)(getPanelHeaderColor(theme, true), opacity);
|
|
434
501
|
});
|
|
435
502
|
});
|
|
436
|
-
exports.StyledPanelTopBar = (0, styled_1.default)(exports.StyledPanelTitle)(
|
|
503
|
+
exports.StyledPanelTopBar = (0, styled_1.default)(exports.StyledPanelTitle)(templateObject_28 || (templateObject_28 = __makeTemplateObject(["\n padding-bottom: ", ";\n padding-top: ", ";\n /* Pinned only while the panel is clearly taller than its scroll area (`$pins`, measured in\n the component). The rest of the sticky treatment - the wrapper's visible overflow, the\n header rounding its own corners - follows `stickyHeader`, so a short panel looks exactly\n as it did and only stops pinning. */\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 // A COLLAPSED panel is its title alone, so the title also meets the panel's bottom corners.\n // Squared there, its surface painted over the panel's rounded bottom edge (a sticky header\n // keeps the panel from clipping) and every collapsed card read as cut off along the bottom.\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n background: ", ";\n // When the header is sticky AND the panel is minimal / transparent (opacity === 0), the\n // header has no surface of its own \u2014 scrolling content slides straight under it and the\n // label / actions become illegible. Apply a backdrop blur so the underlying content stays\n // visible but is softened enough for the header text to read clearly. Idle (no overflow,\n // nothing behind) the blur is a no-op so the static appearance is unchanged.\n ", "\n"], ["\n padding-bottom: ", ";\n padding-top: ", ";\n /* Pinned only while the panel is clearly taller than its scroll area (\\`$pins\\`, measured in\n the component). The rest of the sticky treatment - the wrapper's visible overflow, the\n header rounding its own corners - follows \\`stickyHeader\\`, so a short panel looks exactly\n as it did and only stops pinning. */\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 // A COLLAPSED panel is its title alone, so the title also meets the panel's bottom corners.\n // Squared there, its surface painted over the panel's rounded bottom edge (a sticky header\n // keeps the panel from clipping) and every collapsed card read as cut off along the bottom.\n border-bottom-left-radius: ", ";\n border-bottom-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) {
|
|
437
504
|
var padded = _a.padded, size = _a.size, isCollapsed = _a.isCollapsed, minimal = _a.minimal;
|
|
438
505
|
return !padded || isCollapsed || !minimal
|
|
439
506
|
? "".concat(getPaddingSize(padded, size), "px")
|
|
@@ -448,39 +515,39 @@ exports.StyledPanelTopBar = (0, styled_1.default)(exports.StyledPanelTitle)(temp
|
|
|
448
515
|
? "".concat(getPaddingSize(padded, size), "px")
|
|
449
516
|
: undefined;
|
|
450
517
|
}, function (_a) {
|
|
451
|
-
var
|
|
452
|
-
return (
|
|
518
|
+
var $pins = _a.$pins;
|
|
519
|
+
return ($pins ? 'sticky' : 'relative');
|
|
453
520
|
}, function (_a) {
|
|
454
|
-
var
|
|
455
|
-
return
|
|
521
|
+
var $pins = _a.$pins, _b = _a.stickyHeaderOffset, stickyHeaderOffset = _b === void 0 ? 0 : _b, _c = _a.stickyHeaderInset, stickyHeaderInset = _c === void 0 ? 0 : _c;
|
|
522
|
+
return $pins ? "".concat(stickyHeaderOffset - stickyHeaderInset, "px") : undefined;
|
|
456
523
|
}, function (_a) {
|
|
457
|
-
var
|
|
458
|
-
return (
|
|
524
|
+
var $pins = _a.$pins;
|
|
525
|
+
return ($pins ? 2 : undefined);
|
|
459
526
|
}, function (_a) {
|
|
460
|
-
var stickyHeader = _a.stickyHeader, rounded = _a.rounded, radiusSize = _a.radiusSize, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition, isStuck = _a.isStuck, $mediaAbove = _a.$mediaAbove;
|
|
527
|
+
var stickyHeader = _a.stickyHeader, rounded = _a.rounded, radiusSize = _a.radiusSize, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition, isStuck = _a.isStuck, $mediaAbove = _a.$mediaAbove, theme = _a.theme;
|
|
461
528
|
return stickyHeader && rounded
|
|
462
529
|
? isStuck || $mediaAbove
|
|
463
530
|
? '0px'
|
|
464
|
-
: "".concat(Math.max(0, (0, sizes_1.
|
|
531
|
+
: "".concat(Math.max(0, (0, sizes_1.resolvePanelRadius)(theme, radiusSize) -
|
|
465
532
|
(hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition }) ? 1 : 0)), "px")
|
|
466
533
|
: undefined;
|
|
467
534
|
}, function (_a) {
|
|
468
|
-
var stickyHeader = _a.stickyHeader, rounded = _a.rounded, radiusSize = _a.radiusSize, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition, isStuck = _a.isStuck, $mediaAbove = _a.$mediaAbove;
|
|
535
|
+
var stickyHeader = _a.stickyHeader, rounded = _a.rounded, radiusSize = _a.radiusSize, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition, isStuck = _a.isStuck, $mediaAbove = _a.$mediaAbove, theme = _a.theme;
|
|
469
536
|
return stickyHeader && rounded
|
|
470
537
|
? isStuck || $mediaAbove
|
|
471
538
|
? '0px'
|
|
472
|
-
: "".concat(Math.max(0, (0, sizes_1.
|
|
539
|
+
: "".concat(Math.max(0, (0, sizes_1.resolvePanelRadius)(theme, radiusSize) -
|
|
473
540
|
(hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition }) ? 1 : 0)), "px")
|
|
474
541
|
: undefined;
|
|
475
|
-
}, function (_a) {
|
|
542
|
+
}, function (props) { return collapsedTitleRadius(props); }, function (props) { return collapsedTitleRadius(props); }, function (_a) {
|
|
476
543
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
477
|
-
return (0, polished_1.rgba)((
|
|
544
|
+
return (0, polished_1.rgba)(getPanelHeaderColor(theme), opacity);
|
|
478
545
|
}, function (_a) {
|
|
479
546
|
var stickyHeader = _a.stickyHeader, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
480
547
|
return stickyHeader &&
|
|
481
|
-
opacity === 0 && (0, styled_components_1.css)(
|
|
548
|
+
opacity === 0 && (0, styled_components_1.css)(templateObject_27 || (templateObject_27 = __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 "])));
|
|
482
549
|
});
|
|
483
|
-
exports.StyledPanelBottomActions = (0, styled_1.default)(exports.StyledPanelTitle)(
|
|
550
|
+
exports.StyledPanelBottomActions = (0, styled_1.default)(exports.StyledPanelTitle)(templateObject_29 || (templateObject_29 = __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) {
|
|
484
551
|
var padded = _a.padded, size = _a.size, minimal = _a.minimal;
|
|
485
552
|
return !padded || !minimal
|
|
486
553
|
? "".concat(getPaddingSize(padded, size), "px")
|
|
@@ -497,22 +564,27 @@ exports.StyledPanelBottomActions = (0, styled_1.default)(exports.StyledPanelTitl
|
|
|
497
564
|
}, function (_a) {
|
|
498
565
|
var theme = _a.theme, flat = _a.flat, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
499
566
|
return !flat
|
|
500
|
-
? "1px solid ".concat((0, polished_1.rgba)((0, colors_2.
|
|
567
|
+
? "1px solid ".concat((0, polished_1.rgba)((0, colors_2.getPanelHairlineColor)(theme), opacity))
|
|
501
568
|
: null;
|
|
502
569
|
});
|
|
503
|
-
exports.StyledPanelContent = styled_1.default.div(
|
|
570
|
+
exports.StyledPanelContent = styled_1.default.div(templateObject_30 || (templateObject_30 = __makeTemplateObject(["\n display: ", ";\n /* The sides take the same corner clearance as the title bar and the bottom actions, so the\n title, the content and the actions share one left edge. Unpadded content stays flush. */\n padding: ", ";\n /* That side inset, said, for a child that bleeds to the panel's edges (a list whose bands and\n hairlines reach the sides): `margin-inline: calc(-1 * var(--reqore-panel-inset-x))`. It\n changes with the panel's size and its corner (13px for a small panel under a 14px radius), so\n a child that took back a fixed 16px ran 3px past both sides. 0 when the content is unpadded. */\n --reqore-panel-inset-x: ", ";\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 /* Under a sticky header the body scrolls beneath it, and whatever in the body was positioned with a\n z-index as high as the header's (2) was drawn over it: a table's pinned columns are sticky at 2, and\n come later in the document. A stacking context of its own puts everything in the body in one layer\n under the header, whatever z-index it is given. It is not a containing block, so nothing in the body\n is placed differently; popovers and menus are drawn outside the panel and stay above it. */\n isolation: ", ";\n"], ["\n display: ", ";\n /* The sides take the same corner clearance as the title bar and the bottom actions, so the\n title, the content and the actions share one left edge. Unpadded content stays flush. */\n padding: ", ";\n /* That side inset, said, for a child that bleeds to the panel's edges (a list whose bands and\n hairlines reach the sides): \\`margin-inline: calc(-1 * var(--reqore-panel-inset-x))\\`. It\n changes with the panel's size and its corner (13px for a small panel under a 14px radius), so\n a child that took back a fixed 16px ran 3px past both sides. 0 when the content is unpadded. */\n --reqore-panel-inset-x: ", ";\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 /* Under a sticky header the body scrolls beneath it, and whatever in the body was positioned with a\n z-index as high as the header's (2) was drawn over it: a table's pinned columns are sticky at 2, and\n come later in the document. A stacking context of its own puts everything in the body in one layer\n under the header, whatever z-index it is given. It is not a containing block, so nothing in the body\n is placed differently; popovers and menus are drawn outside the panel and stay above it. */\n isolation: ", ";\n"])), function (_a) {
|
|
504
571
|
var isCollapsed = _a.isCollapsed;
|
|
505
572
|
return (isCollapsed ? 'none !important' : undefined);
|
|
506
573
|
}, function (_a) {
|
|
507
|
-
var padded = _a.padded, size = _a.size, noHorizontalPadding = _a.noHorizontalPadding;
|
|
574
|
+
var padded = _a.padded, size = _a.size, noHorizontalPadding = _a.noHorizontalPadding, _b = _a.$cornerInset, $cornerInset = _b === void 0 ? 0 : _b;
|
|
508
575
|
return !padded
|
|
509
576
|
? undefined
|
|
510
577
|
: noHorizontalPadding
|
|
511
578
|
? "".concat(getPaddingSize(padded, size), "px 0")
|
|
512
|
-
: "".concat(getPaddingSize(padded, size), "px ").concat(getPaddingSize(padded, size), "px");
|
|
579
|
+
: "".concat(getPaddingSize(padded, size), "px ").concat((0, sizes_1.clearCorner)(getPaddingSize(padded, size), $cornerInset), "px");
|
|
513
580
|
}, function (_a) {
|
|
514
|
-
var size = _a.size;
|
|
515
|
-
return
|
|
581
|
+
var padded = _a.padded, size = _a.size, noHorizontalPadding = _a.noHorizontalPadding, _b = _a.$cornerInset, $cornerInset = _b === void 0 ? 0 : _b;
|
|
582
|
+
return !padded || noHorizontalPadding
|
|
583
|
+
? '0px'
|
|
584
|
+
: "".concat((0, sizes_1.clearCorner)(getPaddingSize(padded, size), $cornerInset), "px");
|
|
585
|
+
}, function (_a) {
|
|
586
|
+
var size = _a.size, theme = _a.theme;
|
|
587
|
+
return (0, typeScale_1.getTextSize)(theme, size);
|
|
516
588
|
}, function (_a) {
|
|
517
589
|
var stickyHeader = _a.stickyHeader;
|
|
518
590
|
return (stickyHeader ? 'isolate' : undefined);
|
|
@@ -520,20 +592,20 @@ exports.StyledPanelContent = styled_1.default.div(templateObject_29 || (template
|
|
|
520
592
|
/** The media frame. Its outer corners take the panel's inner curve, so the media is clipped to
|
|
521
593
|
* the panel's shape even where the panel cannot clip it (a sticky header makes the panel
|
|
522
594
|
* overflow visible). */
|
|
523
|
-
exports.StyledPanelMedia = styled_1.default.div(
|
|
595
|
+
exports.StyledPanelMedia = styled_1.default.div(templateObject_34 || (templateObject_34 = __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) {
|
|
524
596
|
var $position = _a.$position, $radius = _a.$radius;
|
|
525
597
|
return $position === 'top'
|
|
526
|
-
? (0, styled_components_1.css)(
|
|
598
|
+
? (0, styled_components_1.css)(templateObject_31 || (templateObject_31 = __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_32 || (templateObject_32 = __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);
|
|
527
599
|
}, function (_a) {
|
|
528
600
|
var $aspectRatio = _a.$aspectRatio;
|
|
529
|
-
return $aspectRatio !== undefined && (0, styled_components_1.css)(
|
|
601
|
+
return $aspectRatio !== undefined && (0, styled_components_1.css)(templateObject_33 || (templateObject_33 = __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);
|
|
530
602
|
});
|
|
531
|
-
exports.StyledFloatingActions = styled_1.default.div(
|
|
603
|
+
exports.StyledFloatingActions = styled_1.default.div(templateObject_35 || (templateObject_35 = __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) {
|
|
532
604
|
var size = _a.size;
|
|
533
605
|
return sizes_1.PADDING_FROM_SIZE[size];
|
|
534
606
|
}, function (_a) {
|
|
535
607
|
var theme = _a.theme;
|
|
536
|
-
return (0, polished_1.rgba)((0, colors_2.
|
|
608
|
+
return (0, polished_1.rgba)((0, colors_2.getPanelBackgroundColor)(theme), 1);
|
|
537
609
|
}, function (_a) {
|
|
538
610
|
var theme = _a.theme, flat = _a.flat, intent = _a.intent;
|
|
539
611
|
return flat && !intent
|
|
@@ -557,7 +629,7 @@ exports.ReqorePanelSkeleton = (0, react_2.memo)(function (_a) {
|
|
|
557
629
|
});
|
|
558
630
|
exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
559
631
|
var _b, _c;
|
|
560
|
-
var children = _a.children, label = _a.label, description = _a.description, _d = _a.collapseButtonProps, collapseButtonProps = _d === void 0 ? {} : _d, collapsible = _a.collapsible, onClose = _a.onClose, _e = _a.closeButtonProps, closeButtonProps = _e === void 0 ? {} : _e, _f = _a.rounded, rounded = _f === void 0 ? true : _f, _g = _a.actions, actions = _g === void 0 ? [] : _g, _h = _a.bottomActions, bottomActions = _h === void 0 ? [] : _h, isCollapsed = _a.isCollapsed, customTheme = _a.customTheme, inheritCustomTheme = _a.inheritCustomTheme, icon = _a.icon, iconImage = _a.iconImage, _j = _a.iconWithLabel, iconWithLabel = _j === void 0 ? false : _j, _k = _a.iconVerticalAlign, iconVerticalAlign = _k === void 0 ? 'center' : _k, intent = _a.intent, className = _a.className, flat = _a.flat, _l = _a.unMountContentOnCollapse, unMountContentOnCollapse = _l === void 0 ? true : _l, onCollapseChange = _a.onCollapseChange, _m = _a.padded, padded = _m === void 0 ? true : _m, _o = _a.wrapperPadding, wrapperPadding = _o === void 0 ? 'both' : _o, contentStyle = _a.contentStyle, contentEffect = _a.contentEffect, _p = _a.labelEffect, labelEffect = _p === void 0 ? {} : _p, _q = _a.descriptionEffect, descriptionEffect = _q === void 0 ? {} : _q, descriptionIntent = _a.descriptionIntent, labelSize = _a.labelSize, contentSize = _a.contentSize, minimal = _a.minimal, badge = _a.badge, iconColor = _a.iconColor, _r = _a.iconProps, iconProps = _r === void 0 ? {} : _r, fluid = _a.fluid, _s = _a.responsiveActions, responsiveActions = _s === void 0 ? true : _s, _t = _a.responsiveTitle, responsiveTitle = _t === void 0 ? true : _t, _u = _a.compactTitle, compactTitle = _u === void 0 ? false : _u, _v = _a.fitLabel, fitLabel = _v === void 0 ? true : _v, _w = _a.labelMaxLines, labelMaxLines = _w === void 0 ? 2 : _w, _x = _a.descriptionPosition, descriptionPosition = _x === void 0 ? 'inline' : _x, _y = _a.descriptionMaxLines, descriptionMaxLines = _y === void 0 ? 2 : _y, labelMinTextSize = _a.labelMinTextSize, _z = _a.size, panelSize = _z === void 0 ? 'normal' : _z, getContentRef = _a.getContentRef, _0 = _a.labelProps, labelProps = _0 === void 0 ? {} : _0, disabled = _a.disabled, breadcrumbs = _a.breadcrumbs, _1 = _a.showActionsWhenCollapsed, showActionsWhenCollapsed = _1 === void 0 ? true : _1, showLabelTooltip = _a.showLabelTooltip, customLabelTooltip = _a.customLabelTooltip, resizable = _a.resizable, onLabelEdit = _a.onLabelEdit, responsiveActionsWrapperProps = _a.responsiveActionsWrapperProps, loading = _a.loading, loadingIconType = _a.loadingIconType, skeleton = _a.skeleton, errorBoundaryOptions = _a.errorBoundaryOptions, floatingActionsProp = _a.floatingActions, _2 = _a.collapseTooltip, collapseTooltip = _2 === void 0 ? 'Collapse' : _2, _3 = _a.expandTooltip, expandTooltip = _3 === void 0 ? 'Expand' : _3, _4 = _a.closeTooltip, closeTooltip = _4 === void 0 ? 'Close' : _4, accentPosition = _a.accentPosition, accentSize = _a.accentSize, media = _a.media, _5 = _a.mediaAlt, mediaAlt = _5 === void 0 ? '' : _5, _6 = _a.mediaPosition, mediaPosition = _6 === void 0 ? 'top' : _6, mediaAspectRatio = _a.mediaAspectRatio, mediaProps = _a.mediaProps, rest = __rest(_a, ["children", "label", "description", "collapseButtonProps", "collapsible", "onClose", "closeButtonProps", "rounded", "actions", "bottomActions", "isCollapsed", "customTheme", "inheritCustomTheme", "icon", "iconImage", "iconWithLabel", "iconVerticalAlign", "intent", "className", "flat", "unMountContentOnCollapse", "onCollapseChange", "padded", "wrapperPadding", "contentStyle", "contentEffect", "labelEffect", "descriptionEffect", "descriptionIntent", "labelSize", "contentSize", "minimal", "badge", "iconColor", "iconProps", "fluid", "responsiveActions", "responsiveTitle", "compactTitle", "fitLabel", "labelMaxLines", "descriptionPosition", "descriptionMaxLines", "labelMinTextSize", "size", "getContentRef", "labelProps", "disabled", "breadcrumbs", "showActionsWhenCollapsed", "showLabelTooltip", "customLabelTooltip", "resizable", "onLabelEdit", "responsiveActionsWrapperProps", "loading", "loadingIconType", "skeleton", "errorBoundaryOptions", "floatingActions", "collapseTooltip", "expandTooltip", "closeTooltip", "accentPosition", "accentSize", "media", "mediaAlt", "mediaPosition", "mediaAspectRatio", "mediaProps"]);
|
|
632
|
+
var children = _a.children, label = _a.label, description = _a.description, _d = _a.collapseButtonProps, collapseButtonProps = _d === void 0 ? {} : _d, collapsible = _a.collapsible, onClose = _a.onClose, _e = _a.closeButtonProps, closeButtonProps = _e === void 0 ? {} : _e, _f = _a.rounded, rounded = _f === void 0 ? true : _f, _g = _a.actions, actions = _g === void 0 ? [] : _g, _h = _a.bottomActions, bottomActions = _h === void 0 ? [] : _h, isCollapsed = _a.isCollapsed, customTheme = _a.customTheme, inheritCustomTheme = _a.inheritCustomTheme, icon = _a.icon, iconImage = _a.iconImage, _j = _a.iconWithLabel, iconWithLabel = _j === void 0 ? false : _j, _k = _a.iconVerticalAlign, iconVerticalAlign = _k === void 0 ? 'center' : _k, intent = _a.intent, className = _a.className, flat = _a.flat, _l = _a.unMountContentOnCollapse, unMountContentOnCollapse = _l === void 0 ? true : _l, onCollapseChange = _a.onCollapseChange, _m = _a.padded, padded = _m === void 0 ? true : _m, _o = _a.wrapperPadding, wrapperPadding = _o === void 0 ? 'both' : _o, contentStyle = _a.contentStyle, contentEffect = _a.contentEffect, _p = _a.labelEffect, labelEffect = _p === void 0 ? {} : _p, _q = _a.descriptionEffect, descriptionEffect = _q === void 0 ? {} : _q, descriptionIntent = _a.descriptionIntent, labelSize = _a.labelSize, contentSize = _a.contentSize, minimal = _a.minimal, badge = _a.badge, iconColor = _a.iconColor, _r = _a.iconProps, iconProps = _r === void 0 ? {} : _r, fluid = _a.fluid, _s = _a.responsiveActions, responsiveActions = _s === void 0 ? true : _s, _t = _a.responsiveTitle, responsiveTitle = _t === void 0 ? true : _t, _u = _a.compactTitle, compactTitle = _u === void 0 ? false : _u, _v = _a.fitLabel, fitLabel = _v === void 0 ? true : _v, _w = _a.labelMaxLines, labelMaxLines = _w === void 0 ? 2 : _w, _x = _a.descriptionPosition, descriptionPosition = _x === void 0 ? 'inline' : _x, _y = _a.descriptionMaxLines, descriptionMaxLines = _y === void 0 ? 2 : _y, descriptionMaxHeight = _a.descriptionMaxHeight, enclosingRadius = _a.enclosingRadius, labelMinTextSize = _a.labelMinTextSize, _z = _a.size, panelSize = _z === void 0 ? 'normal' : _z, getContentRef = _a.getContentRef, _0 = _a.labelProps, labelProps = _0 === void 0 ? {} : _0, disabled = _a.disabled, breadcrumbs = _a.breadcrumbs, _1 = _a.showActionsWhenCollapsed, showActionsWhenCollapsed = _1 === void 0 ? true : _1, showLabelTooltip = _a.showLabelTooltip, customLabelTooltip = _a.customLabelTooltip, resizable = _a.resizable, onLabelEdit = _a.onLabelEdit, responsiveActionsWrapperProps = _a.responsiveActionsWrapperProps, loading = _a.loading, loadingIconType = _a.loadingIconType, skeleton = _a.skeleton, errorBoundaryOptions = _a.errorBoundaryOptions, floatingActionsProp = _a.floatingActions, _2 = _a.collapseTooltip, collapseTooltip = _2 === void 0 ? 'Collapse' : _2, _3 = _a.expandTooltip, expandTooltip = _3 === void 0 ? 'Expand' : _3, _4 = _a.closeTooltip, closeTooltip = _4 === void 0 ? 'Close' : _4, accentPosition = _a.accentPosition, accentSize = _a.accentSize, media = _a.media, _5 = _a.mediaAlt, mediaAlt = _5 === void 0 ? '' : _5, _6 = _a.mediaPosition, mediaPosition = _6 === void 0 ? 'top' : _6, mediaAspectRatio = _a.mediaAspectRatio, mediaProps = _a.mediaProps, rest = __rest(_a, ["children", "label", "description", "collapseButtonProps", "collapsible", "onClose", "closeButtonProps", "rounded", "actions", "bottomActions", "isCollapsed", "customTheme", "inheritCustomTheme", "icon", "iconImage", "iconWithLabel", "iconVerticalAlign", "intent", "className", "flat", "unMountContentOnCollapse", "onCollapseChange", "padded", "wrapperPadding", "contentStyle", "contentEffect", "labelEffect", "descriptionEffect", "descriptionIntent", "labelSize", "contentSize", "minimal", "badge", "iconColor", "iconProps", "fluid", "responsiveActions", "responsiveTitle", "compactTitle", "fitLabel", "labelMaxLines", "descriptionPosition", "descriptionMaxLines", "descriptionMaxHeight", "enclosingRadius", "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"]);
|
|
561
633
|
// Resolved ONCE, here — the accent styles interpolate px and reserve padding,
|
|
562
634
|
// so they must only ever see a number. Shared with ReqoreCallout.
|
|
563
635
|
var accentSizePx = (0, react_2.useMemo)(function () { return (0, utils_1.resolveAccentSize)(accentSize); }, [accentSize]);
|
|
@@ -605,10 +677,13 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
605
677
|
var stickySentinelRef = (0, react_2.useRef)(null);
|
|
606
678
|
var _10 = (0, react_2.useState)(false), isHeaderStuck = _10[0], setIsHeaderStuck = _10[1];
|
|
607
679
|
var _11 = (0, react_2.useState)(0), stickyInset = _11[0], setStickyInset = _11[1];
|
|
680
|
+
// Whether the panel is tall enough for its sticky header to pin (STICKY_HEADER_TALL_SCREENS).
|
|
681
|
+
var _12 = (0, react_2.useState)(false), isTallEnoughToPin = _12[0], setIsTallEnoughToPin = _12[1];
|
|
608
682
|
(0, react_2.useEffect)(function () {
|
|
609
683
|
var _a;
|
|
610
684
|
if (!rest.stickyHeader) {
|
|
611
685
|
setIsHeaderStuck(false);
|
|
686
|
+
setIsTallEnoughToPin(false);
|
|
612
687
|
return undefined;
|
|
613
688
|
}
|
|
614
689
|
var sentinel = stickySentinelRef.current;
|
|
@@ -620,7 +695,14 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
620
695
|
// Read once per layout change, not per scroll frame: `measure()` runs in a
|
|
621
696
|
// rAF on every scroll and already forces a layout read.
|
|
622
697
|
var inset = getScrollportInset(scrollParent);
|
|
698
|
+
var tall = false;
|
|
623
699
|
setStickyInset(inset.padding);
|
|
700
|
+
var measureTall = function () {
|
|
701
|
+
var _a, _b;
|
|
702
|
+
var panelHeight = (_b = (_a = panelRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height) !== null && _b !== void 0 ? _b : 0;
|
|
703
|
+
tall = panelHeight > getScrollportVisibleHeight(scrollParent) * exports.STICKY_HEADER_TALL_SCREENS;
|
|
704
|
+
setIsTallEnoughToPin(tall);
|
|
705
|
+
};
|
|
624
706
|
var measure = function () {
|
|
625
707
|
frame = 0;
|
|
626
708
|
var sentinelTop = sentinel.getBoundingClientRect().top;
|
|
@@ -630,8 +712,9 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
630
712
|
// radius through exactly the gap this fix closes.
|
|
631
713
|
var rootTop = scrollParent ? scrollParent.getBoundingClientRect().top + inset.border : 0;
|
|
632
714
|
// 1px deadzone so the exact at-rest position (sentinel flush against the
|
|
633
|
-
// top) never reads as stuck.
|
|
634
|
-
|
|
715
|
+
// top) never reads as stuck. A header that does not pin is never stuck:
|
|
716
|
+
// it scrolls away with its panel.
|
|
717
|
+
setIsHeaderStuck(tall && sentinelTop < rootTop + offset - 1);
|
|
635
718
|
};
|
|
636
719
|
var onScroll = function () {
|
|
637
720
|
if (!frame)
|
|
@@ -640,17 +723,21 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
640
723
|
var onLayout = function () {
|
|
641
724
|
inset = getScrollportInset(scrollParent);
|
|
642
725
|
setStickyInset(inset.padding);
|
|
726
|
+
measureTall();
|
|
643
727
|
onScroll();
|
|
644
728
|
};
|
|
729
|
+
measureTall();
|
|
645
730
|
measure();
|
|
646
731
|
document.addEventListener('scroll', onScroll, { capture: true, passive: true });
|
|
647
732
|
window.addEventListener('resize', onLayout, { passive: true });
|
|
648
733
|
// Responsive padding changes the inset without a window resize or a
|
|
649
|
-
// scroll, and the header would stay compensated by the old value.
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
734
|
+
// scroll, and the header would stay compensated by the old value. The panel
|
|
735
|
+
// itself is watched too: rows arriving make a short panel tall.
|
|
736
|
+
var observer = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(onLayout) : undefined;
|
|
737
|
+
if (scrollParent)
|
|
738
|
+
observer === null || observer === void 0 ? void 0 : observer.observe(scrollParent);
|
|
739
|
+
if (panelRef.current)
|
|
740
|
+
observer === null || observer === void 0 ? void 0 : observer.observe(panelRef.current);
|
|
654
741
|
return function () {
|
|
655
742
|
document.removeEventListener('scroll', onScroll, true);
|
|
656
743
|
window.removeEventListener('resize', onLayout);
|
|
@@ -975,12 +1062,19 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
975
1062
|
showActionsWhenCollapsed,
|
|
976
1063
|
_isCollapsed,
|
|
977
1064
|
]);
|
|
978
|
-
var renderActions = (0, react_2.useCallback)(function (action, index, includeResponsive, align
|
|
1065
|
+
var renderActions = (0, react_2.useCallback)(function (action, index, includeResponsive, align,
|
|
1066
|
+
/* A group's child: the group has been put in its bar already, so the child is drawn
|
|
1067
|
+
whatever its own \`responsive\` says, which then only decides whether its label folds.
|
|
1068
|
+
A child with \`responsive: false\` (a split button's words) was filtered out as though
|
|
1069
|
+
it belonged to the other bar, and only the caret was drawn (qlip-ui). */
|
|
1070
|
+
inGroup) {
|
|
979
1071
|
if (align === void 0) { align = 'flex-end'; }
|
|
1072
|
+
if (inGroup === void 0) { inGroup = false; }
|
|
980
1073
|
if (action.show === false ||
|
|
981
1074
|
(showActionsWhenCollapsed === false && _isCollapsed === true) ||
|
|
982
|
-
(includeResponsive && action.responsive === false) ||
|
|
983
|
-
(!
|
|
1075
|
+
(!inGroup && includeResponsive && action.responsive === false) ||
|
|
1076
|
+
(!inGroup &&
|
|
1077
|
+
!includeResponsive &&
|
|
984
1078
|
responsiveActions &&
|
|
985
1079
|
(action.responsive === true || !('responsive' in action)))) {
|
|
986
1080
|
return null;
|
|
@@ -990,7 +1084,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
990
1084
|
// If the show prop is 'hover', add the hidden class to the action
|
|
991
1085
|
className = (0, classnames_1.default)(className, show === 'hover' ? 'reqore-panel-action-hidden' : '');
|
|
992
1086
|
if ((0, lodash_1.size)(group)) {
|
|
993
|
-
return ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, { intent: intent, stack: true, customTheme: rest.customTheme || theme, size: rest.size, fixed: rest.fixed, fluid: rest.fluid, className: className, horizontalAlign: align, children: group.map(function (
|
|
1087
|
+
return ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, { intent: intent, stack: true, customTheme: rest.customTheme || theme, size: rest.size, fixed: rest.fixed, fluid: rest.fluid, className: className, horizontalAlign: align, children: group.map(function (child, index) { return renderActions(child, index, true, undefined, true); }) }, index));
|
|
994
1088
|
}
|
|
995
1089
|
if ((0, lodash_1.size)(actions)) {
|
|
996
1090
|
return ((0, react_1.createElement)(Dropdown_1.default, __assign({ fixed: true }, rest, { key: index, label: label, intent: intent, className: className, customTheme: rest.customTheme || theme, id: id }, actionsProps, { items: actions.filter(utils_1.isActionShown), onClick: function (e) { return e.stopPropagation(); } })));
|
|
@@ -1048,9 +1142,17 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1048
1142
|
// The media frame's outer corners follow the panel's INNER curve: its radius, less the 1px
|
|
1049
1143
|
// border when it draws one — the same inset the sticky header and the accent strip take.
|
|
1050
1144
|
var mediaRadius = rounded
|
|
1051
|
-
? Math.max(0, (0, sizes_1.
|
|
1145
|
+
? Math.max(0, (0, sizes_1.resolvePanelRadius)(theme, rest.radiusSize) -
|
|
1052
1146
|
(hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition }) ? 1 : 0))
|
|
1053
1147
|
: 0;
|
|
1148
|
+
// The title bar, the padded content and the bottom actions start clear of that same inner
|
|
1149
|
+
// curve — one left edge for all three — and of the
|
|
1150
|
+
// corner of a container the panel sits flush in (`enclosingRadius`), less the panel's own
|
|
1151
|
+
// border. A panel with no surface and no edge (`noHorizontalPadding`) draws no corner, and
|
|
1152
|
+
// keeps its bars flush.
|
|
1153
|
+
var cornerInset = noHorizontalPadding
|
|
1154
|
+
? 0
|
|
1155
|
+
: Math.max(mediaRadius, (0, sizes_1.clearCorner)(0, enclosingRadius !== null && enclosingRadius !== void 0 ? enclosingRadius : 0, hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition }) ? 1 : 0));
|
|
1054
1156
|
var hasMedia = media !== undefined && media !== null && media !== false && media !== '';
|
|
1055
1157
|
var mediaNode = (0, react_2.useMemo)(function () {
|
|
1056
1158
|
return hasMedia ? ((0, jsx_runtime_1.jsx)(exports.StyledPanelMedia, __assign({}, mediaProps, { className: (0, classnames_1.default)(mediaProps === null || mediaProps === void 0 ? void 0 : mediaProps.className, 'reqore-panel-media', "reqore-panel-media-".concat(mediaPosition)), "$position": mediaPosition, "$radius": mediaRadius, "$aspectRatio": mediaAspectRatio, children: typeof media === 'string' ? ((0, jsx_runtime_1.jsx)("img", { src: media, alt: mediaAlt, decoding: 'async', className: 'reqore-panel-media-image' })) : (media) }))) : null;
|
|
@@ -1076,7 +1178,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1076
1178
|
* The title's natural size in px, from the heading level it renders at — the same
|
|
1077
1179
|
* `labelSize || HEADER_SIZE_TO_NUMBER[panelSize]` the icon is sized from.
|
|
1078
1180
|
*/
|
|
1079
|
-
var labelNaturalPx = (_b =
|
|
1181
|
+
var labelNaturalPx = (_b = (0, typeScale_1.getHeadingSize)(theme, labelSize || sizes_1.HEADER_SIZE_TO_NUMBER[panelSize])) !== null && _b !== void 0 ? _b : (0, typeScale_1.getHeadingSize)(theme, 3);
|
|
1080
1182
|
/**
|
|
1081
1183
|
* SECOND thing to give: the title's size. Once the actions are down to icons and the
|
|
1082
1184
|
* row is still short, the title shrinks toward a floor rather than dropping characters
|
|
@@ -1106,8 +1208,8 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1106
1208
|
* way it always has. When it IS cut, that same click must not reach the bar — opening the
|
|
1107
1209
|
* text and folding the panel away in one gesture is the worst of both.
|
|
1108
1210
|
*/
|
|
1109
|
-
var
|
|
1110
|
-
var
|
|
1211
|
+
var _13 = (0, react_2.useState)(false), isDescriptionExpanded = _13[0], setIsDescriptionExpanded = _13[1];
|
|
1212
|
+
var _14 = (0, react_2.useState)(false), isDescriptionTruncated = _14[0], setIsDescriptionTruncated = _14[1];
|
|
1111
1213
|
var descriptionRef = (0, react_2.useRef)(null);
|
|
1112
1214
|
var descriptionIsClamped = descriptionClamp > 0 && !isDescriptionExpanded;
|
|
1113
1215
|
(0, react_2.useLayoutEffect)(function () {
|
|
@@ -1126,7 +1228,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1126
1228
|
}, [descriptionIsInteractive]);
|
|
1127
1229
|
/** Shared by both places the description can render — inline with the title, or on its
|
|
1128
1230
|
* own row below — so the two cannot drift apart. */
|
|
1129
|
-
var descriptionProps = __assign({ ref: descriptionRef, className: 'reqore-panel-title-description', size: panelSize, effect: __assign({
|
|
1231
|
+
var descriptionProps = __assign({ ref: descriptionRef, className: 'reqore-panel-title-description', size: panelSize, effect: __assign(__assign({}, (0, colors_2.getSecondaryTextEffect)(theme, 0.7)), descriptionEffect), intent: descriptionIntent, onClick: handleDescriptionClick }, (descriptionIsInteractive
|
|
1130
1232
|
? {
|
|
1131
1233
|
role: 'button',
|
|
1132
1234
|
tabIndex: 0,
|
|
@@ -1140,19 +1242,20 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1140
1242
|
style: { cursor: 'pointer' },
|
|
1141
1243
|
}
|
|
1142
1244
|
: {}));
|
|
1143
|
-
var
|
|
1144
|
-
var
|
|
1245
|
+
var _15 = (0, react_2.useState)(undefined), labelAvailable = _15[0], setLabelAvailable = _15[1];
|
|
1246
|
+
var _16 = (0, useFitTextSize_1.useFitTextSize)({
|
|
1145
1247
|
text: typeof label === 'string' ? label : '',
|
|
1146
1248
|
available: labelAvailable,
|
|
1147
1249
|
max: labelNaturalPx,
|
|
1148
1250
|
min: labelMinTextSize,
|
|
1149
1251
|
lines: clampLines,
|
|
1150
1252
|
enabled: fitLabel !== false && typeof label === 'string' && !(labelEffect === null || labelEffect === void 0 ? void 0 : labelEffect.textSize),
|
|
1151
|
-
}), labelFitRef =
|
|
1253
|
+
}), labelFitRef = _16[0], labelFitPx = _16[1];
|
|
1152
1254
|
/** Only while the title is actually below its natural size, and never over a caller who
|
|
1153
1255
|
* pinned the description's own size. */
|
|
1154
1256
|
var descriptionFontPx = fitLabel && !(descriptionEffect === null || descriptionEffect === void 0 ? void 0 : descriptionEffect.textSize) && labelFitPx < labelNaturalPx
|
|
1155
|
-
? Math.max(useFitTextSize_1.FIT_TEXT_FLOOR_PX, Math.round(((_c =
|
|
1257
|
+
? Math.max(useFitTextSize_1.FIT_TEXT_FLOOR_PX, Math.round(((_c = (0, typeScale_1.getTextSize)(theme, panelSize)) !== null && _c !== void 0 ? _c : (0, typeScale_1.getTextSize)(theme, 'normal')) *
|
|
1258
|
+
(labelFitPx / labelNaturalPx)))
|
|
1156
1259
|
: 0;
|
|
1157
1260
|
/**
|
|
1158
1261
|
* How much room the title has, computed rather than measured off its own box.
|
|
@@ -1197,11 +1300,22 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1197
1300
|
var style = getComputedStyle(parent);
|
|
1198
1301
|
var padding = (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0);
|
|
1199
1302
|
var gap = parseFloat(style.columnGap) || parseFloat(style.gap) || 0;
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1303
|
+
/* A badge beside the title takes real width from it. A badge on the line under it takes
|
|
1304
|
+
none: the badges move there before the title gives anything, so the title then has the
|
|
1305
|
+
whole line. Which line a badge is on is read from the layout, after the line has taken
|
|
1306
|
+
its items at their full width, and the title's natural size decides it: a title shrinks
|
|
1307
|
+
only once its badges are below it, and then keeps them there (`$ownLine`). */
|
|
1308
|
+
var nodeBox = node.getBoundingClientRect();
|
|
1309
|
+
var besideTitle = Array.from(parent.children).filter(function (child) { return child !== node && child.getBoundingClientRect().top < nodeBox.bottom - 1; });
|
|
1310
|
+
// By the room each takes on the line: a text badge is pulled back by its padding.
|
|
1311
|
+
var siblings = besideTitle.reduce(function (total, child) {
|
|
1312
|
+
var _a = getComputedStyle(child), marginLeft = _a.marginLeft, marginRight = _a.marginRight;
|
|
1313
|
+
return (total +
|
|
1314
|
+
child.getBoundingClientRect().width +
|
|
1315
|
+
(parseFloat(marginLeft) || 0) +
|
|
1316
|
+
(parseFloat(marginRight) || 0));
|
|
1203
1317
|
}, 0);
|
|
1204
|
-
var gaps = gap *
|
|
1318
|
+
var gaps = gap * besideTitle.length;
|
|
1205
1319
|
/* What the title could still gain, which the box measured above does not show: the box is
|
|
1206
1320
|
only as wide as the title at its present size, so a title shrunk on a narrow bar measured
|
|
1207
1321
|
that small box when the bar widened again, and stayed shrunk however wide the bar became
|
|
@@ -1222,6 +1336,35 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1222
1336
|
var next = Math.max(0, Math.round(parent.clientWidth - padding - siblings - gaps + Math.max(0, headerRoom) + actionsRoom));
|
|
1223
1337
|
setLabelAvailable(function (current) { return (current === next ? current : next); });
|
|
1224
1338
|
}, [fitLabel, label, width, badge, actions, panelSize, description, clampLines, isNarrow]);
|
|
1339
|
+
/**
|
|
1340
|
+
* Where the icon goes once the badges move under the title: beside the title, centred on it.
|
|
1341
|
+
* Centred on the whole label as before, it sat beside the badges' line ("Order Sync Template"
|
|
1342
|
+
* on a phone, its kind icon next to "In review"), as if it were theirs. The offset, in px from
|
|
1343
|
+
* the top of the title's row, is measured: the title may be one line or two, and at any size.
|
|
1344
|
+
* Only for the centred icon (the default); `iconVerticalAlign` 'top' or 'bottom' is the
|
|
1345
|
+
* caller's choice and stays.
|
|
1346
|
+
*/
|
|
1347
|
+
var titleLineRef = (0, react_2.useRef)(null);
|
|
1348
|
+
var _17 = (0, react_2.useState)(undefined), iconBesideTitle = _17[0], setIconBesideTitle = _17[1];
|
|
1349
|
+
(0, react_2.useLayoutEffect)(function () {
|
|
1350
|
+
var _a;
|
|
1351
|
+
var line = titleLineRef.current;
|
|
1352
|
+
var title = line === null || line === void 0 ? void 0 : line.firstElementChild;
|
|
1353
|
+
var iconElement = (_a = line === null || line === void 0 ? void 0 : line.closest('.reqore-panel-title-header')) === null || _a === void 0 ? void 0 : _a.querySelector('.reqore-panel-title-icon');
|
|
1354
|
+
var next;
|
|
1355
|
+
if (line && title && iconElement && iconVerticalAlign === 'center') {
|
|
1356
|
+
var titleBox_1 = title.getBoundingClientRect();
|
|
1357
|
+
var badgesBelow = Array.from(line.children)
|
|
1358
|
+
.slice(1)
|
|
1359
|
+
.some(function (child) { return child.getBoundingClientRect().top >= titleBox_1.bottom - 1; });
|
|
1360
|
+
if (badgesBelow) {
|
|
1361
|
+
next = Math.max(0, Math.round(titleBox_1.top -
|
|
1362
|
+
line.getBoundingClientRect().top +
|
|
1363
|
+
(titleBox_1.height - iconElement.getBoundingClientRect().height) / 2));
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
setIconBesideTitle(function (current) { return (current === next ? current : next); });
|
|
1367
|
+
}, [width, label, badge, labelFitPx, icon, iconImage, iconVerticalAlign, description]);
|
|
1225
1368
|
var iconTooltip = (0, react_2.useMemo)(function () { return ({
|
|
1226
1369
|
content: label,
|
|
1227
1370
|
}); }, [label]);
|
|
@@ -1240,7 +1383,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1240
1383
|
panelRef.current = node;
|
|
1241
1384
|
}, 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 &&
|
|
1242
1385
|
(0, lodash_1.size)(floatingActionsList) > 0 &&
|
|
1243
|
-
(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 () {
|
|
1386
|
+
(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, "$descriptionMaxHeight": descriptionIsClamped ? undefined : descriptionMaxHeight, "$descriptionFontPx": descriptionFontPx, "data-narrow": isNarrow ? 'true' : 'false', ref: measureRef, padded: padded, wrapperPadding: wrapperPadding, intent: intent, rounded: rounded, radiusSize: rest.radiusSize, stickyHeader: rest.stickyHeader, "$pins": !!rest.stickyHeader && isTallEnoughToPin, "data-pins-header": rest.stickyHeader ? String(isTallEnoughToPin) : undefined, stickyHeaderOffset: rest.stickyHeaderOffset, stickyHeaderInset: stickyInset, isStuck: isHeaderStuck, "$mediaAbove": hasMedia && mediaPosition === 'top' && !_isCollapsed, "$cornerInset": cornerInset, 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 () {
|
|
1244
1387
|
var hasPanelIcon = !!icon || !!iconImage || loading;
|
|
1245
1388
|
// The icon takes the label's place, so there has to BE an icon. Without one
|
|
1246
1389
|
// the label is the only thing identifying the panel and it stays put — a
|
|
@@ -1271,29 +1414,39 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1271
1414
|
var iconMargin = useOuterGrid ? undefined : 'right';
|
|
1272
1415
|
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: iconColor, tooltip: iconTooltip, effect: {
|
|
1273
1416
|
opacity: colors_1.CONTROL_ICON_OPACITY,
|
|
1274
|
-
} }, iconProps, {
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1417
|
+
} }, iconProps, { style: iconBesideTitle === undefined
|
|
1418
|
+
? iconProps === null || iconProps === void 0 ? void 0 : iconProps.style
|
|
1419
|
+
: __assign(__assign({}, iconProps === null || iconProps === void 0 ? void 0 : iconProps.style), {
|
|
1420
|
+
// Beside the title, not the badges under it: on the title's
|
|
1421
|
+
// row alone, from its top.
|
|
1422
|
+
alignSelf: 'flex-start', gridRow: useOuterGrid ? '1' : undefined, marginTop: iconBesideTitle }), 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;
|
|
1423
|
+
var labelRow = ((0, jsx_runtime_1.jsxs)(exports.StyledPanelTitleHeaderLabelAndBadge, { className: 'reqore-panel-title-label-row', children: [inlineWithLabel && panelIcon, (0, jsx_runtime_1.jsx)(TitleAndBadges_1.ReqoreTitleAndBadges, { ref: titleLineRef, badge: badge, badgeSize: (0, utils_1.getOneHigherSize)(panelSize),
|
|
1424
|
+
// The room the badges keep from the title, which a spacer before them
|
|
1425
|
+
// used to hold.
|
|
1426
|
+
gap: sizes_1.PADDING_FROM_SIZE[(0, utils_1.getOneHigherSize)(panelSize)], children: hideTitleText ? null : typeof label === 'string' ? (
|
|
1427
|
+
// The measured box is this wrapper, not the heading: as a
|
|
1428
|
+
// `min-width: 0` flex child it reports the width the row actually
|
|
1429
|
+
// left for the title, where the heading would report what the text
|
|
1430
|
+
// wants. `overflow: hidden` is what makes it shrinkable at all.
|
|
1431
|
+
// `display: flex` keeps the wrapper from opening a line box around
|
|
1432
|
+
// the inline-flex heading: a block wrapper adds the row's leading on
|
|
1433
|
+
// top of the heading's own box, which made a `tiny` panel 3px taller
|
|
1434
|
+
// than it was before this wrapper existed.
|
|
1435
|
+
(0, jsx_runtime_1.jsx)(StyledPanelTitleLabelBox, { ref: labelFitRef, className: 'reqore-panel-title-label-box', "$clampLines": clampLines, "$ownLine": fitLabel !== false &&
|
|
1436
|
+
!(labelEffect === null || labelEffect === void 0 ? void 0 : labelEffect.textSize) &&
|
|
1437
|
+
labelFitPx < labelNaturalPx, children: (0, jsx_runtime_1.jsx)(LabelEditor_1.LabelEditor, { size: labelSize || panelSize, customTheme: theme, effect: __assign({
|
|
1438
|
+
// `noWrap` pins the heading to one line; a clamped title is
|
|
1439
|
+
// allowed to wrap, and the clamp brings its own ellipsis.
|
|
1440
|
+
noWrap: clampLines === 1 }, labelEffect), style: __assign(__assign(__assign({}, (clampLines > 1
|
|
1441
|
+
? {}
|
|
1442
|
+
: { display: 'inline-flex', alignItems: 'center' })), { minWidth: 0,
|
|
1443
|
+
// Capped to the measured wrapper so the heading's own
|
|
1444
|
+
// `text-overflow: ellipsis` (from `noWrap`) has a box to overflow.
|
|
1445
|
+
// An `inline-flex` heading otherwise sizes to its text, and the
|
|
1446
|
+
// wrapper clips it mid-word with no ellipsis at all.
|
|
1447
|
+
maxWidth: '100%' }), (fitLabel !== false && !(labelEffect === null || labelEffect === void 0 ? void 0 : labelEffect.textSize)
|
|
1448
|
+
? { fontSize: "".concat(labelFitPx, "px") }
|
|
1449
|
+
: {})), label: label, onSubmit: onLabelEdit, tooltip: showLabelTooltip ? customLabelTooltip || label : undefined }) })) : (label) })] }));
|
|
1297
1450
|
// Description size is driven by the panel size only —
|
|
1298
1451
|
// explicitly NOT by `labelSize`. `NUMBER_TO_SIZE` maps
|
|
1299
1452
|
// 1..6 → micro..huge, which means bumping `labelSize`
|
|
@@ -1366,7 +1519,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1366
1519
|
// `flex-basis: 100%` is what puts it on its own line — the bar is a wrapping
|
|
1367
1520
|
// flex row, so a full-width item cannot share one with anything before it.
|
|
1368
1521
|
// `min-width: 0` so a long sentence wraps inside the bar instead of widening it.
|
|
1369
|
-
(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, stickyHeader: rest.stickyHeader, children: children })) : null, hasBottomActions && !_isCollapsed ? ((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] })) })));
|
|
1522
|
+
(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, "$cornerInset": cornerInset, stickyHeader: rest.stickyHeader, children: children })) : null, hasBottomActions && !_isCollapsed ? ((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, "$cornerInset": cornerInset, 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] })) })));
|
|
1370
1523
|
});
|
|
1371
|
-
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;
|
|
1524
|
+
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, templateObject_35;
|
|
1372
1525
|
//# sourceMappingURL=index.js.map
|