@qoretechnologies/reqore 0.76.0-pr.663.gf5793e2 → 0.76.0-pr.667.g4fafa42
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/Button/index.d.ts +11 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +9 -5
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Collection/index.d.ts +7 -8
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +32 -21
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +123 -10
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/Drawer/index.d.ts +90 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +149 -21
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Dropdown/item.d.ts +1 -1
- package/dist/components/Dropdown/item.d.ts.map +1 -1
- package/dist/components/Dropdown/item.js +20 -4
- package/dist/components/Dropdown/item.js.map +1 -1
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Dropdown/list.js +41 -24
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Effect/index.d.ts +24 -1
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js.map +1 -1
- package/dist/components/EntityRow/index.d.ts +1 -0
- package/dist/components/EntityRow/index.d.ts.map +1 -1
- package/dist/components/EntityRow/index.js +6 -5
- package/dist/components/EntityRow/index.js.map +1 -1
- package/dist/components/InternalPopover/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.js +6 -3
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/Message/index.js +6 -6
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/MultiSelect/index.d.ts +3 -3
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/MultiSelect/index.js.map +1 -1
- package/dist/components/Notifications/index.d.ts.map +1 -1
- package/dist/components/Notifications/index.js +8 -1
- package/dist/components/Notifications/index.js.map +1 -1
- package/dist/components/Notifications/notification.d.ts +72 -32
- package/dist/components/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +257 -96
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Notifications/styles.d.ts +41 -0
- package/dist/components/Notifications/styles.d.ts.map +1 -0
- package/dist/components/Notifications/styles.js +131 -0
- package/dist/components/Notifications/styles.js.map +1 -0
- package/dist/components/Panel/index.d.ts +48 -8
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +216 -100
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Panel/responsive.d.ts +24 -0
- package/dist/components/Panel/responsive.d.ts.map +1 -0
- package/dist/components/Panel/responsive.js +30 -0
- package/dist/components/Panel/responsive.js.map +1 -0
- package/dist/components/Paragraph/index.d.ts +8 -0
- package/dist/components/Paragraph/index.d.ts.map +1 -1
- package/dist/components/Paragraph/index.js.map +1 -1
- package/dist/components/Popover/index.d.ts +37 -3
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +164 -5
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.js +12 -3
- package/dist/components/RadioGroup/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +286 -46
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/Select/index.d.ts +68 -29
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +42 -117
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/valuePreview.d.ts +11 -0
- package/dist/components/Select/valuePreview.d.ts.map +1 -0
- package/dist/components/Select/valuePreview.js +64 -0
- package/dist/components/Select/valuePreview.js.map +1 -0
- package/dist/components/Table/body.d.ts.map +1 -1
- package/dist/components/Table/body.js +31 -10
- 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 +6 -6
- package/dist/components/Table/cell.js.map +1 -1
- package/dist/components/Table/helpers.d.ts +62 -28
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +106 -55
- package/dist/components/Table/helpers.js.map +1 -1
- package/dist/components/Table/index.d.ts +30 -2
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +15 -6
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/row.d.ts +29 -1
- package/dist/components/Table/row.d.ts.map +1 -1
- package/dist/components/Table/row.js +76 -12
- package/dist/components/Table/row.js.map +1 -1
- package/dist/components/Tag/index.d.ts +5 -2
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +39 -23
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Textarea/index.d.ts +10 -0
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +60 -3
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/components/Tree/index.d.ts +2 -1
- package/dist/components/Tree/index.d.ts.map +1 -1
- package/dist/components/Tree/index.js +31 -9
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/ReqoreProvider.js +23 -5
- package/dist/containers/ReqoreProvider.js.map +1 -1
- package/dist/containers/UIProvider.d.ts +3 -0
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/context/ReqoreContext.d.ts +14 -1
- package/dist/context/ReqoreContext.d.ts.map +1 -1
- package/dist/context/ReqoreContext.js.map +1 -1
- package/dist/helpers/selectItem.d.ts +23 -0
- package/dist/helpers/selectItem.d.ts.map +1 -0
- package/dist/helpers/selectItem.js +147 -0
- package/dist/helpers/selectItem.js.map +1 -0
- package/dist/helpers/utils.d.ts +1 -1
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/hooks/useFitTextSize.d.ts +14 -1
- package/dist/hooks/useFitTextSize.d.ts.map +1 -1
- package/dist/hooks/useFitTextSize.js +8 -5
- package/dist/hooks/useFitTextSize.js.map +1 -1
- package/dist/hooks/useMarqueeOnHover.d.ts +86 -0
- package/dist/hooks/useMarqueeOnHover.d.ts.map +1 -0
- package/dist/hooks/useMarqueeOnHover.js +292 -0
- package/dist/hooks/useMarqueeOnHover.js.map +1 -0
- package/dist/hooks/usePaging.d.ts.map +1 -1
- package/dist/hooks/usePaging.js +29 -2
- package/dist/hooks/usePaging.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +23 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/tableGeometry.d.ts +75 -0
- package/dist/testing/tableGeometry.d.ts.map +1 -0
- package/dist/testing/tableGeometry.js +168 -0
- package/dist/testing/tableGeometry.js.map +1 -0
- package/dist/types/global.d.ts +6 -6
- package/dist/types/global.d.ts.map +1 -1
- package/package.json +10 -3
- package/testing/package.json +7 -0
|
@@ -72,6 +72,7 @@ var re_resizable_1 = require("re-resizable");
|
|
|
72
72
|
var react_2 = require("react");
|
|
73
73
|
var react_dom_1 = require("react-dom");
|
|
74
74
|
var react_use_1 = require("react-use");
|
|
75
|
+
var responsive_1 = require("./responsive");
|
|
75
76
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
76
77
|
var colors_1 = require("../../constants/colors");
|
|
77
78
|
var sizes_1 = require("../../constants/sizes");
|
|
@@ -135,16 +136,29 @@ var getScrollportInset = function (el) {
|
|
|
135
136
|
border: parseFloat(style.borderTopWidth) || 0,
|
|
136
137
|
};
|
|
137
138
|
};
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
/**
|
|
140
|
+
* The box the title lives in — and, when the title may wrap, the thing that clamps it.
|
|
141
|
+
*
|
|
142
|
+
* It exists first as a measuring box: as a `min-width: 0` flex child it reports the width the
|
|
143
|
+
* row actually left for the title, where the heading itself would report what its text wants.
|
|
144
|
+
* `overflow: hidden` is what makes it shrinkable at all, and `display: flex` keeps it from
|
|
145
|
+
* opening a line box around the inline-flex heading — a block wrapper adds the row's leading on
|
|
146
|
+
* top of the heading's own box, which made a `tiny` panel 3px taller than it used to be.
|
|
147
|
+
*/
|
|
148
|
+
var StyledPanelTitleLabelBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n min-width: 0;\n overflow: hidden;\n flex: 0 1 auto;\n\n ", "\n"], ["\n display: flex;\n min-width: 0;\n overflow: hidden;\n flex: 0 1 auto;\n\n ", "\n"])), function (_a) {
|
|
149
|
+
var $clampLines = _a.$clampLines;
|
|
150
|
+
return $clampLines > 1 && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .reqore-heading {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ", ";\n overflow: hidden;\n white-space: normal;\n /* A single word longer than the box would push past it rather than break, and the\n clamp would have nothing to ellipsize. */\n overflow-wrap: anywhere;\n max-width: 100%;\n\n /* The heading wraps its text in a span of its own, and `-webkit-line-clamp` counts the\n box's CHILDREN rather than the lines inside them \u2014 so one block-level child reads as\n a single line and nothing is ever clamped, however far the text overruns. Putting the\n text back into the heading's own line boxes is what the clamp actually measures. */\n .reqore-span {\n display: inline;\n }\n }\n "], ["\n .reqore-heading {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ", ";\n overflow: hidden;\n white-space: normal;\n /* A single word longer than the box would push past it rather than break, and the\n clamp would have nothing to ellipsize. */\n overflow-wrap: anywhere;\n max-width: 100%;\n\n /* The heading wraps its text in a span of its own, and \\`-webkit-line-clamp\\` counts the\n box's CHILDREN rather than the lines inside them \u2014 so one block-level child reads as\n a single line and nothing is ever clamped, however far the text overruns. Putting the\n text back into the heading's own line boxes is what the clamp actually measures. */\n .reqore-span {\n display: inline;\n }\n }\n "])), $clampLines);
|
|
151
|
+
});
|
|
152
|
+
exports.StyledPanelTitleHeader = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\n display: flex;\n justify-content: flex-start;\n align-items: center;\n /* A CONTENT basis, and both extremes were tried before settling here. Basis 0 hands the action\n group beside this one its full content width, so nothing ever overflows and the fold into the\n menu never fires \u2014 actions labelled \"hidden when small\" stay visible on a small panel. A 100%\n width does the opposite: this header claims the entire row, so the group is always crushed to\n its floor and always folds however much room there is, which hid Tree's save button behind an\n overflow menu on a panel with space to spare. On a content basis the two shrink against each\n other in proportion to what they each need, which is the only version where folding means\n \"there is no room\" rather than \"there is a header\". */\n flex: 1 1 auto;\n overflow: hidden;\n"], ["\n\n display: flex;\n justify-content: flex-start;\n align-items: center;\n /* A CONTENT basis, and both extremes were tried before settling here. Basis 0 hands the action\n group beside this one its full content width, so nothing ever overflows and the fold into the\n menu never fires \u2014 actions labelled \"hidden when small\" stay visible on a small panel. A 100%\n width does the opposite: this header claims the entire row, so the group is always crushed to\n its floor and always folds however much room there is, which hid Tree's save button behind an\n overflow menu on a panel with space to spare. On a content basis the two shrink against each\n other in proportion to what they each need, which is the only version where folding means\n \"there is no room\" rather than \"there is a header\". */\n flex: 1 1 auto;\n overflow: hidden;\n"])));
|
|
153
|
+
exports.StyledPanelTitleHeaderContent = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n // When the icon lives in the outer container (iconVerticalAlign mode),\n // we use a 2-column \u00D7 N-row CSS Grid where the LABEL ROW and DESCRIPTION\n // ROW are direct grid items \u2014 not wrapped inside a span-2 stack. That\n // makes each row's auto-sized height equal to the actual text row's\n // line-box height, so 'align-self: center' on the icon (in column 1)\n // visually centres the icon against the text row it shares a grid row\n // with \u2014 no font-metric guesswork.\n display: ", ";\n ", "\n flex: 0 1 auto;\n overflow: hidden;\n min-width: ", "px;\n"], ["\n // When the icon lives in the outer container (iconVerticalAlign mode),\n // we use a 2-column \u00D7 N-row CSS Grid where the LABEL ROW and DESCRIPTION\n // ROW are direct grid items \u2014 not wrapped inside a span-2 stack. That\n // makes each row's auto-sized height equal to the actual text row's\n // line-box height, so 'align-self: center' on the icon (in column 1)\n // visually centres the icon against the text row it shares a grid row\n // with \u2014 no font-metric guesswork.\n display: ", ";\n ", "\n flex: 0 1 auto;\n overflow: hidden;\n min-width: ", "px;\n"])), function (_a) {
|
|
140
154
|
var $hasOuterIcon = _a.$hasOuterIcon;
|
|
141
155
|
return ($hasOuterIcon ? 'grid' : 'flex');
|
|
142
156
|
}, function (_a) {
|
|
143
157
|
var $hasOuterIcon = _a.$hasOuterIcon, size = _a.size, _b = _a.$iconVerticalAlign, $iconVerticalAlign = _b === void 0 ? 'center' : _b, $hasDescription = _a.$hasDescription;
|
|
144
158
|
return $hasOuterIcon
|
|
145
|
-
? (0, styled_components_1.css)(
|
|
146
|
-
? (0, styled_components_1.css)(
|
|
147
|
-
? (0, styled_components_1.css)(
|
|
159
|
+
? (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n // 'auto' lets the column grow to the icon's actual rendered size \u2014\n // important when consumers pass a custom 'iconProps.size' that does\n // not match the default size derived from 'panelSize'/'labelSize'.\n // 'iconSize' is still passed via 'min-width' below to ensure a\n // sensible minimum reservation when the row is otherwise empty.\n grid-template-columns: auto minmax(0, 1fr);\n grid-template-rows: ", ";\n column-gap: ", "px;\n row-gap: 3px;\n align-items: start;\n\n & > .reqore-panel-title-icon {\n ", "\n grid-column: 1;\n align-self: center;\n justify-self: start;\n // Suppress 'vertical-align: super' that ReqoreIcon applies to its\n // SVG for inline-text contexts. In our grid layout the wrapper is\n // already vertically centred against the text row's line-box;\n // 'display: block' takes the SVG out of inline flow entirely so\n // baseline/super offsets cannot push it off-centre. The wrapper's\n // own 'align-items: center' then centres the SVG within itself.\n & svg {\n display: block;\n vertical-align: middle;\n }\n }\n\n & > .reqore-panel-title-label-row {\n grid-column: 2;\n grid-row: 1;\n min-width: 0;\n }\n\n & > .reqore-panel-title-description {\n grid-column: 2;\n grid-row: 2;\n min-width: 0;\n }\n "], ["\n // 'auto' lets the column grow to the icon's actual rendered size \u2014\n // important when consumers pass a custom 'iconProps.size' that does\n // not match the default size derived from 'panelSize'/'labelSize'.\n // 'iconSize' is still passed via 'min-width' below to ensure a\n // sensible minimum reservation when the row is otherwise empty.\n grid-template-columns: auto minmax(0, 1fr);\n grid-template-rows: ", ";\n column-gap: ", "px;\n row-gap: 3px;\n align-items: start;\n\n & > .reqore-panel-title-icon {\n ", "\n grid-column: 1;\n align-self: center;\n justify-self: start;\n // Suppress 'vertical-align: super' that ReqoreIcon applies to its\n // SVG for inline-text contexts. In our grid layout the wrapper is\n // already vertically centred against the text row's line-box;\n // 'display: block' takes the SVG out of inline flow entirely so\n // baseline/super offsets cannot push it off-centre. The wrapper's\n // own 'align-items: center' then centres the SVG within itself.\n & svg {\n display: block;\n vertical-align: middle;\n }\n }\n\n & > .reqore-panel-title-label-row {\n grid-column: 2;\n grid-row: 1;\n min-width: 0;\n }\n\n & > .reqore-panel-title-description {\n grid-column: 2;\n grid-row: 2;\n min-width: 0;\n }\n "])), $hasDescription ? 'auto auto' : 'auto', sizes_1.PADDING_FROM_SIZE[size || 'normal'], $iconVerticalAlign === 'top'
|
|
160
|
+
? (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n grid-row: 1;\n "], ["\n grid-row: 1;\n "]))) : $iconVerticalAlign === 'bottom' && $hasDescription
|
|
161
|
+
? (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n grid-row: 2;\n "], ["\n grid-row: 2;\n "]))) : (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n grid-row: 1 / ", ";\n "], ["\n grid-row: 1 / ", ";\n "])), $hasDescription ? 3 : 2)) : (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n justify-content: flex-start;\n align-items: center;\n "], ["\n justify-content: flex-start;\n align-items: center;\n "])));
|
|
148
162
|
}, function (_a) {
|
|
149
163
|
var iconSize = _a.iconSize, hasIcon = _a.hasIcon;
|
|
150
164
|
var width = 0;
|
|
@@ -153,8 +167,8 @@ exports.StyledPanelTitleHeaderContent = styled_components_1.default.div(template
|
|
|
153
167
|
}
|
|
154
168
|
return width;
|
|
155
169
|
});
|
|
156
|
-
exports.StyledPanelTitleHeaderLabelAndDescription = styled_components_1.default.div(
|
|
157
|
-
exports.StyledPanelTitleHeaderLabelAndBadge = styled_components_1.default.div(
|
|
170
|
+
exports.StyledPanelTitleHeaderLabelAndDescription = styled_components_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"])));
|
|
171
|
+
exports.StyledPanelTitleHeaderLabelAndBadge = styled_components_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"])));
|
|
158
172
|
/**
|
|
159
173
|
* Does the panel wrapper draw its 1px border?
|
|
160
174
|
*
|
|
@@ -185,7 +199,7 @@ exports.StyledPanel = (0, styled_components_1.default)(Effect_1.StyledEffect).wi
|
|
|
185
199
|
// Everything else follows styled-components' own rule, so re-resizable still receives its
|
|
186
200
|
// `enable` / size / handle config — those are component props, not HTML attributes.
|
|
187
201
|
shouldForwardProp: (0, styled_1.omitStyleProps)('fill', 'accentPosition'),
|
|
188
|
-
})(
|
|
202
|
+
})(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) {
|
|
189
203
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
190
204
|
return (0, polished_1.rgba)((0, colors_2.changeDarkness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity);
|
|
191
205
|
}, function (_a) {
|
|
@@ -220,13 +234,11 @@ exports.StyledPanel = (0, styled_components_1.default)(Effect_1.StyledEffect).wi
|
|
|
220
234
|
? Math.max(0, (0, sizes_1.resolveRadius)('normal', radiusSize) -
|
|
221
235
|
(hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition }) ? 1 : 0))
|
|
222
236
|
: 0;
|
|
223
|
-
return (0, styled_components_1.css)(
|
|
224
|
-
? (0, styled_components_1.css)(
|
|
237
|
+
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'
|
|
238
|
+
? (0, styled_components_1.css)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n top: 0;\n bottom: 0;\n left: 0;\n width: ", "px;\n "], ["\n top: 0;\n bottom: 0;\n left: 0;\n width: ", "px;\n "])), $accentSize) : (0, styled_components_1.css)(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n top: 0;\n right: 0;\n left: 0;\n height: ", "px;\n "], ["\n top: 0;\n right: 0;\n left: 0;\n height: ", "px;\n "])), $accentSize), stripRadius
|
|
225
239
|
? accentPosition === 'left'
|
|
226
|
-
? (0, styled_components_1.css)(
|
|
227
|
-
: undefined, intent
|
|
228
|
-
? theme.intents[intent]
|
|
229
|
-
: (0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.22));
|
|
240
|
+
? (0, styled_components_1.css)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n "], ["\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n "])), stripRadius, stripRadius) : (0, styled_components_1.css)(templateObject_15 || (templateObject_15 = __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 "])), stripRadius, stripRadius)
|
|
241
|
+
: undefined, intent ? theme.intents[intent] : (0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.22));
|
|
230
242
|
}, function (_a) {
|
|
231
243
|
var stickyHeader = _a.stickyHeader;
|
|
232
244
|
return (stickyHeader ? 'visible' : 'hidden');
|
|
@@ -242,23 +254,35 @@ exports.StyledPanel = (0, styled_components_1.default)(Effect_1.StyledEffect).wi
|
|
|
242
254
|
}, function (_a) {
|
|
243
255
|
var interactive = _a.interactive, theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition;
|
|
244
256
|
return interactive
|
|
245
|
-
? (0, styled_components_1.css)(
|
|
257
|
+
? (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
|
|
246
258
|
? undefined
|
|
247
259
|
: (0, polished_1.rgba)((0, polished_1.darken)(0.025, (0, polished_1.rgba)((0, colors_2.changeDarkness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity)), opacity), hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition })
|
|
248
260
|
? (0, colors_2.changeLightness)(getPanelBorderBaseColor(theme, { intent: intent, accentPosition: accentPosition }), 0.25)
|
|
249
|
-
: undefined, opacity !== 0 && (0, styled_components_1.css)(
|
|
261
|
+
: 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.changeDarkness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity)), opacity))) : undefined;
|
|
250
262
|
}, function (_a) {
|
|
251
263
|
var raised = _a.raised, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition;
|
|
252
264
|
return raised && !hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition }) && styles_1.RaisedElement;
|
|
253
265
|
}, function (_a) {
|
|
254
266
|
var fill = _a.fill, isCollapsed = _a.isCollapsed;
|
|
255
267
|
return !isCollapsed && fill
|
|
256
|
-
? (0, styled_components_1.css)(
|
|
268
|
+
? (0, styled_components_1.css)(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n height: 100%;\n flex: 1;\n "], ["\n height: 100%;\n flex: 1;\n "]))) : undefined;
|
|
257
269
|
}, function (_a) {
|
|
258
270
|
var disabled = _a.disabled;
|
|
259
271
|
return disabled && styles_1.DisabledElement;
|
|
260
272
|
});
|
|
261
|
-
exports.StyledPanelTitle = styled_components_1.default.div(
|
|
273
|
+
exports.StyledPanelTitle = styled_components_1.default.div(templateObject_25 || (templateObject_25 = __makeTemplateObject(["\n display: flex;\n /* Always a row. The title bar used to flip to a column when narrow; it now ellipsizes its\n label and lets the responsive action group collapse instead, which is what the \"hidden when\n small\" actions are for and what the stack was quietly defeating (a column made the group\n fluid, and a full-width group had room not to collapse). */\n flex-flow: ", ";\n\n ", "\n\n ", "\n\n ", "\n\n background-color: ", ";\n justify-content: space-between;\n\n padding: ", ";\n\n align-items: center;\n border-bottom: ", ";\n transition: background-color 0.2s ease-out;\n overflow: hidden;\n flex: 0 0 auto;\n gap: ", "px;\n\n ", " .reqore-panel-title-icon {\n transform: scale(", ");\n }\n\n ", "\n"], ["\n display: flex;\n /* Always a row. The title bar used to flip to a column when narrow; it now ellipsizes its\n label and lets the responsive action group collapse instead, which is what the \"hidden when\n small\" actions are for and what the stack was quietly defeating (a column made the group\n fluid, and a full-width group had room not to collapse). */\n flex-flow: ", ";\n\n ", "\n\n ", "\n\n ", "\n\n background-color: ", ";\n justify-content: space-between;\n\n padding: ", ";\n\n align-items: center;\n border-bottom: ", ";\n transition: background-color 0.2s ease-out;\n overflow: hidden;\n flex: 0 0 auto;\n gap: ", "px;\n\n ", " .reqore-panel-title-icon {\n transform: scale(", ");\n }\n\n ", "\n"])), function (_a) {
|
|
274
|
+
var $descriptionBelow = _a.$descriptionBelow;
|
|
275
|
+
return ($descriptionBelow ? 'row wrap' : 'row');
|
|
276
|
+
}, function (_a) {
|
|
277
|
+
var $descriptionFontPx = _a.$descriptionFontPx;
|
|
278
|
+
return !!$descriptionFontPx && (0, styled_components_1.css)(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n /* The description is a fixed px from `TEXT_FROM_SIZE` and knows nothing about the title\n having shrunk, so a fitted title crosses under it: at the 12px floor the support text\n renders at 15px and outranks the heading it supports. Scaling it by the SAME factor the\n title took keeps the two in their original proportion instead of giving the description\n a fit of its own \u2014 which would size it against its own box and let the pair drift apart\n again, in the other direction. */\n .reqore-panel-title-description {\n font-size: ", "px;\n }\n "], ["\n /* The description is a fixed px from \\`TEXT_FROM_SIZE\\` and knows nothing about the title\n having shrunk, so a fitted title crosses under it: at the 12px floor the support text\n renders at 15px and outranks the heading it supports. Scaling it by the SAME factor the\n title took keeps the two in their original proportion instead of giving the description\n a fit of its own \u2014 which would size it against its own box and let the pair drift apart\n again, in the other direction. */\n .reqore-panel-title-description {\n font-size: ", "px;\n }\n "])), $descriptionFontPx);
|
|
279
|
+
}, function (_a) {
|
|
280
|
+
var $descriptionBelow = _a.$descriptionBelow;
|
|
281
|
+
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 "])));
|
|
282
|
+
}, function (_a) {
|
|
283
|
+
var $descriptionMaxLines = _a.$descriptionMaxLines;
|
|
284
|
+
return !!$descriptionMaxLines && (0, styled_components_1.css)(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n .reqore-panel-title-description {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ", ";\n overflow: hidden;\n white-space: normal;\n overflow-wrap: anywhere;\n }\n "], ["\n .reqore-panel-title-description {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ", ";\n overflow: hidden;\n white-space: normal;\n overflow-wrap: anywhere;\n }\n "])), $descriptionMaxLines);
|
|
285
|
+
}, function (_a) {
|
|
262
286
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
263
287
|
return (0, polished_1.rgba)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity);
|
|
264
288
|
}, function (_a) {
|
|
@@ -271,12 +295,12 @@ exports.StyledPanelTitle = styled_components_1.default.div(templateObject_20 ||
|
|
|
271
295
|
: null;
|
|
272
296
|
}, sizes_1.GAP_FROM_SIZE.normal, exports.StyledPanelTitleHeaderContent, styles_1.INACTIVE_ICON_SCALE, function (_a) {
|
|
273
297
|
var collapsible = _a.collapsible;
|
|
274
|
-
return collapsible && (0, styled_components_1.css)(
|
|
298
|
+
return collapsible && (0, styled_components_1.css)(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n cursor: pointer;\n &:hover {\n ", " .reqore-panel-title-icon {\n transform: scale(", ");\n }\n\n background-color: ", ";\n }\n "], ["\n cursor: pointer;\n &:hover {\n ", " .reqore-panel-title-icon {\n transform: scale(", ");\n }\n\n background-color: ", ";\n }\n "])), exports.StyledPanelTitleHeaderContent, styles_1.ACTIVE_ICON_SCALE, function (_a) {
|
|
275
299
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
276
300
|
return (0, polished_1.rgba)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.05), opacity);
|
|
277
301
|
});
|
|
278
302
|
});
|
|
279
|
-
exports.StyledPanelTopBar = (0, styled_components_1.default)(exports.StyledPanelTitle)(
|
|
303
|
+
exports.StyledPanelTopBar = (0, styled_components_1.default)(exports.StyledPanelTitle)(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n padding-bottom: ", ";\n padding-top: ", ";\n position: ", ";\n /* `top: 0` must mean \"flush with the visible top edge of whatever scrolls\",\n which is what every call site assumes. Sticky resolves against the scroll\n container's CONTENT box, so on a padded scrollport \u2014 which every default\n panel/drawer/modal body is, since StyledPanelContent puts padding and\n overflow on one element \u2014 an uncompensated 0 parks the header below the\n padding and lets content scroll through the gap. `stickyHeaderInset` is\n that padding, measured from the real scroll ancestor at runtime;\n `stickyHeaderOffset` stays a deliberate caller offset on top of a now\n correct zero. */\n top: ", ";\n z-index: ", ";\n // A sticky header forces the panel wrapper to overflow visible (so the\n // header can stick), which stops the wrapper from clipping the header's top\n // corners \u2014 so without this the panel reads as square-topped even at rest.\n // AT REST, round the header's own top corners to the panel's inner radius so\n // the panel keeps its radius (inset 1px past a visible border to match the\n // wrapper's inner curve; flat border-less panels need no inset). ONCE STUCK\n // (pinned to the scroll container, detected at runtime via isStuck), drop the\n // radius to 0 so the pinned header reads as a full-width bar and only loses\n // its corners while it is actually moving with the scroll.\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n background: ", ";\n // When the header is sticky AND the panel is minimal / transparent (opacity === 0), the\n // header has no surface of its own \u2014 scrolling content slides straight under it and the\n // label / actions become illegible. Apply a backdrop blur so the underlying content stays\n // visible but is softened enough for the header text to read clearly. Idle (no overflow,\n // nothing behind) the blur is a no-op so the static appearance is unchanged.\n ", "\n"], ["\n padding-bottom: ", ";\n padding-top: ", ";\n position: ", ";\n /* \\`top: 0\\` must mean \"flush with the visible top edge of whatever scrolls\",\n which is what every call site assumes. Sticky resolves against the scroll\n container's CONTENT box, so on a padded scrollport \u2014 which every default\n panel/drawer/modal body is, since StyledPanelContent puts padding and\n overflow on one element \u2014 an uncompensated 0 parks the header below the\n padding and lets content scroll through the gap. \\`stickyHeaderInset\\` is\n that padding, measured from the real scroll ancestor at runtime;\n \\`stickyHeaderOffset\\` stays a deliberate caller offset on top of a now\n correct zero. */\n top: ", ";\n z-index: ", ";\n // A sticky header forces the panel wrapper to overflow visible (so the\n // header can stick), which stops the wrapper from clipping the header's top\n // corners \u2014 so without this the panel reads as square-topped even at rest.\n // AT REST, round the header's own top corners to the panel's inner radius so\n // the panel keeps its radius (inset 1px past a visible border to match the\n // wrapper's inner curve; flat border-less panels need no inset). ONCE STUCK\n // (pinned to the scroll container, detected at runtime via isStuck), drop the\n // radius to 0 so the pinned header reads as a full-width bar and only loses\n // its corners while it is actually moving with the scroll.\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n background: ", ";\n // When the header is sticky AND the panel is minimal / transparent (opacity === 0), the\n // header has no surface of its own \u2014 scrolling content slides straight under it and the\n // label / actions become illegible. Apply a backdrop blur so the underlying content stays\n // visible but is softened enough for the header text to read clearly. Idle (no overflow,\n // nothing behind) the blur is a no-op so the static appearance is unchanged.\n ", "\n"])), function (_a) {
|
|
280
304
|
var padded = _a.padded, size = _a.size, isCollapsed = _a.isCollapsed, minimal = _a.minimal;
|
|
281
305
|
return !padded || isCollapsed || !minimal
|
|
282
306
|
? "".concat(getPaddingSize(padded, size), "px")
|
|
@@ -321,9 +345,9 @@ exports.StyledPanelTopBar = (0, styled_components_1.default)(exports.StyledPanel
|
|
|
321
345
|
}, function (_a) {
|
|
322
346
|
var stickyHeader = _a.stickyHeader, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
323
347
|
return stickyHeader &&
|
|
324
|
-
opacity === 0 && (0, styled_components_1.css)(
|
|
348
|
+
opacity === 0 && (0, styled_components_1.css)(templateObject_26 || (templateObject_26 = __makeTemplateObject(["\n backdrop-filter: blur(30px);\n -webkit-backdrop-filter: blur(30px);\n "], ["\n backdrop-filter: blur(30px);\n -webkit-backdrop-filter: blur(30px);\n "])));
|
|
325
349
|
});
|
|
326
|
-
exports.StyledPanelBottomActions = (0, styled_components_1.default)(exports.StyledPanelTitle)(
|
|
350
|
+
exports.StyledPanelBottomActions = (0, styled_components_1.default)(exports.StyledPanelTitle)(templateObject_28 || (templateObject_28 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n border-bottom: 0;\n border-top: ", ";\n"], ["\n padding-top: ", ";\n padding-bottom: ", ";\n border-bottom: 0;\n border-top: ", ";\n"])), function (_a) {
|
|
327
351
|
var padded = _a.padded, size = _a.size, minimal = _a.minimal;
|
|
328
352
|
return !padded || !minimal
|
|
329
353
|
? "".concat(getPaddingSize(padded, size), "px")
|
|
@@ -343,7 +367,7 @@ exports.StyledPanelBottomActions = (0, styled_components_1.default)(exports.Styl
|
|
|
343
367
|
? "1px solid ".concat((0, polished_1.rgba)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.08), opacity))
|
|
344
368
|
: null;
|
|
345
369
|
});
|
|
346
|
-
exports.StyledPanelContent = styled_components_1.default.div(
|
|
370
|
+
exports.StyledPanelContent = styled_components_1.default.div(templateObject_29 || (templateObject_29 = __makeTemplateObject(["\n display: ", ";\n padding: ", ";\n flex: 1;\n /* A flex child's min-height defaults to its content size, so without this the\n scrollable content can't shrink: a panel/drawer body taller than the panel\n pushes the (flex: 0 0 auto) bottom-actions footer past the panel's clipped\n edge and strands it, instead of scrolling. */\n min-height: 0;\n overflow: auto;\n overflow-wrap: anywhere;\n font-size: ", "px;\n"], ["\n display: ", ";\n padding: ", ";\n flex: 1;\n /* A flex child's min-height defaults to its content size, so without this the\n scrollable content can't shrink: a panel/drawer body taller than the panel\n pushes the (flex: 0 0 auto) bottom-actions footer past the panel's clipped\n edge and strands it, instead of scrolling. */\n min-height: 0;\n overflow: auto;\n overflow-wrap: anywhere;\n font-size: ", "px;\n"])), function (_a) {
|
|
347
371
|
var isCollapsed = _a.isCollapsed;
|
|
348
372
|
return (isCollapsed ? 'none !important' : undefined);
|
|
349
373
|
}, function (_a) {
|
|
@@ -357,7 +381,7 @@ exports.StyledPanelContent = styled_components_1.default.div(templateObject_24 |
|
|
|
357
381
|
var size = _a.size;
|
|
358
382
|
return sizes_1.TEXT_FROM_SIZE[size];
|
|
359
383
|
});
|
|
360
|
-
exports.StyledFloatingActions = styled_components_1.default.div(
|
|
384
|
+
exports.StyledFloatingActions = styled_components_1.default.div(templateObject_30 || (templateObject_30 = __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) {
|
|
361
385
|
var size = _a.size;
|
|
362
386
|
return sizes_1.PADDING_FROM_SIZE[size];
|
|
363
387
|
}, function (_a) {
|
|
@@ -385,12 +409,12 @@ exports.ReqorePanelSkeleton = (0, react_2.memo)(function (_a) {
|
|
|
385
409
|
(children ? (children) : ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, { vertical: true, children: (0, jsx_runtime_1.jsx)(Skeleton_1.ReqoreSkeleton, { lines: 5, width: '100%', size: 'tiny' }) })))] }));
|
|
386
410
|
});
|
|
387
411
|
exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
388
|
-
var _b;
|
|
389
|
-
var children = _a.children, label = _a.label, description = _a.description,
|
|
412
|
+
var _b, _c;
|
|
413
|
+
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, floatingActions = _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, 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"]);
|
|
390
414
|
// Resolved ONCE, here — the accent styles interpolate px and reserve padding,
|
|
391
415
|
// so they must only ever see a number. Shared with ReqoreCallout.
|
|
392
416
|
var accentSizePx = (0, react_2.useMemo)(function () { return (0, utils_1.resolveAccentSize)(accentSize); }, [accentSize]);
|
|
393
|
-
var
|
|
417
|
+
var _5 = (0, react_2.useState)(isCollapsed || false), _isCollapsed = _5[0], setIsCollapsed = _5[1];
|
|
394
418
|
var primaryContentGradient = (0, Effect_1.getPrimaryGradient)(contentEffect === null || contentEffect === void 0 ? void 0 : contentEffect.gradient);
|
|
395
419
|
var primaryContentColors = primaryContentGradient && typeof primaryContentGradient.colors === 'object'
|
|
396
420
|
? primaryContentGradient.colors
|
|
@@ -408,8 +432,8 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
408
432
|
}, []);
|
|
409
433
|
var isMobile = (0, useReqoreContext_1.useReqoreProperty)('isMobile');
|
|
410
434
|
var targetRef = (0, useCombinedRefs_1.useCombinedRefs)(ref).targetRef;
|
|
411
|
-
var
|
|
412
|
-
var
|
|
435
|
+
var _6 = (0, react_use_1.useMeasure)(), measureRef = _6[0], width = _6[1].width;
|
|
436
|
+
var _7 = (0, react_2.useState)(false), _isHovered = _7[0], setIsHovered = _7[1];
|
|
413
437
|
var floatingActionsRef = (0, react_2.useRef)(null);
|
|
414
438
|
var panelRef = (0, react_2.useRef)(null);
|
|
415
439
|
var hoverTimerRef = (0, react_2.useRef)(null);
|
|
@@ -427,8 +451,8 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
427
451
|
// triggers it. Only wired when `stickyHeader` is on, so ordinary panels pay
|
|
428
452
|
// nothing.
|
|
429
453
|
var stickySentinelRef = (0, react_2.useRef)(null);
|
|
430
|
-
var
|
|
431
|
-
var
|
|
454
|
+
var _8 = (0, react_2.useState)(false), isHeaderStuck = _8[0], setIsHeaderStuck = _8[1];
|
|
455
|
+
var _9 = (0, react_2.useState)(0), stickyInset = _9[0], setStickyInset = _9[1];
|
|
432
456
|
(0, react_2.useEffect)(function () {
|
|
433
457
|
var _a;
|
|
434
458
|
if (!rest.stickyHeader) {
|
|
@@ -452,9 +476,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
452
476
|
// pins to. Comparing against the bare border box flips `isHeaderStuck`
|
|
453
477
|
// late by the scrollport's inset, so a pinned header keeps its top
|
|
454
478
|
// radius through exactly the gap this fix closes.
|
|
455
|
-
var rootTop = scrollParent
|
|
456
|
-
? scrollParent.getBoundingClientRect().top + inset.border
|
|
457
|
-
: 0;
|
|
479
|
+
var rootTop = scrollParent ? scrollParent.getBoundingClientRect().top + inset.border : 0;
|
|
458
480
|
// 1px deadzone so the exact at-rest position (sentinel flush against the
|
|
459
481
|
// top) never reads as stuck.
|
|
460
482
|
setIsHeaderStuck(sentinelTop < rootTop + offset - 1);
|
|
@@ -591,7 +613,12 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
591
613
|
* Asking whether the width was MEASURED says what the guard always meant. jsdom keeps its 0
|
|
592
614
|
* and stays wide, so the unit suite is unaffected; a browser measures and behaves.
|
|
593
615
|
*/
|
|
594
|
-
|
|
616
|
+
/* The same rule, from the helper that carries it and its tests —
|
|
617
|
+
`panelIsSmall` is `responsiveTitle && width > 0 && width < 480`, written
|
|
618
|
+
once so the unit suite can reach it without mounting a panel. Both sides
|
|
619
|
+
of this merge fixed the unmeasured-panel bug independently; keeping the
|
|
620
|
+
expression in two places is how they would drift. */
|
|
621
|
+
var isSmall = (0, react_2.useMemo)(function () { return (0, responsive_1.panelIsSmall)(width, responsiveTitle); }, [width, responsiveTitle]);
|
|
595
622
|
/**
|
|
596
623
|
* Narrow, from either trigger: the panel measuring under 480px, or the provider's
|
|
597
624
|
* viewport-level `isMobile`.
|
|
@@ -609,25 +636,6 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
609
636
|
* in full on a small panel.
|
|
610
637
|
*/
|
|
611
638
|
var isNarrow = isSmall || isMobile;
|
|
612
|
-
/**
|
|
613
|
-
* The size the action buttons render at, stepped down as the bar narrows.
|
|
614
|
-
*
|
|
615
|
-
* Progressive rather than a single switch at the narrow threshold: one step taken once means
|
|
616
|
-
* every panel below 480px renders identical buttons, which reads as "the buttons never
|
|
617
|
-
* change" precisely where the room is tightest. Each step is worth roughly 8px per button,
|
|
618
|
-
* so a three-button row buys the title ~25px per step.
|
|
619
|
-
*/
|
|
620
|
-
var actionSize = (0, react_2.useMemo)(function () {
|
|
621
|
-
if (!fitActions || !width) {
|
|
622
|
-
return panelSize;
|
|
623
|
-
}
|
|
624
|
-
var steps = width >= 480 ? 0 : width >= 380 ? 1 : 2;
|
|
625
|
-
return steps === 0
|
|
626
|
-
? panelSize
|
|
627
|
-
: steps === 1
|
|
628
|
-
? (0, utils_1.getOneLessSize)(panelSize)
|
|
629
|
-
: (0, utils_1.getOneLessSize)((0, utils_1.getOneLessSize)(panelSize));
|
|
630
|
-
}, [fitActions, width, panelSize]);
|
|
631
639
|
/**
|
|
632
640
|
* The tightest fallback, still opt-in: drop the title TEXT and leave the icon in its place.
|
|
633
641
|
* For a bar too narrow even to ellipsize into — a `[icon] [actions] [×]` header. Nothing
|
|
@@ -675,9 +683,15 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
675
683
|
// effect. That is what silently defeated dropping the action labels: the flag flipped and
|
|
676
684
|
// the closure did not. (`renderActions` itself cannot go here: it is declared below.)
|
|
677
685
|
[isNarrow, actions, showActionsWhenCollapsed, _isCollapsed]);
|
|
678
|
-
var hasNonResponsiveActions = (0, react_2.useCallback)(
|
|
679
|
-
|
|
680
|
-
|
|
686
|
+
var hasNonResponsiveActions = (0, react_2.useCallback)(
|
|
687
|
+
// `show: false` has to be honoured on BOTH paths. The `responsiveActions: false` arm used
|
|
688
|
+
// to ask only whether the array had entries, so a panel whose every action is hidden still
|
|
689
|
+
// reported having some and rendered an empty control group. It went unnoticed while the
|
|
690
|
+
// prop defaulted to `true` and that arm was mostly dead.
|
|
691
|
+
function (data) {
|
|
692
|
+
return data.some(function (action) {
|
|
693
|
+
return (!responsiveActions || action.responsive === false) && action.show !== false;
|
|
694
|
+
});
|
|
681
695
|
}, [actions, bottomActions, responsiveActions, showActionsWhenCollapsed, _isCollapsed]);
|
|
682
696
|
var hasResponsiveActions = (0, react_2.useCallback)(function (data) {
|
|
683
697
|
return responsiveActions &&
|
|
@@ -732,8 +746,15 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
732
746
|
// a blank box — and a caller can pin the label with `responsive: false`.
|
|
733
747
|
// `label` on an action is typed `string | number`; a tooltip is not, so the numeric
|
|
734
748
|
// case is stringified rather than cast away.
|
|
749
|
+
//
|
|
750
|
+
// `responsive: false` has to be read HERE, not only by the group that renders the
|
|
751
|
+
// action: it used to decide which control group an action was rendered in and
|
|
752
|
+
// nothing else, so a pinned label was dropped anyway and the escape hatch this
|
|
753
|
+
// comment promises did not exist. It is what the confirmation dialog stands on —
|
|
754
|
+
// two unlabelled squares, a tick and a cross, name neither the action nor the
|
|
755
|
+
// one that throws the work away.
|
|
735
756
|
var actionLabelTooltip = typeof label === 'number' ? String(label) : label;
|
|
736
|
-
var dropActionLabel = isNarrow && !!rest.icon && !!label;
|
|
757
|
+
var dropActionLabel = isNarrow && action.responsive !== false && !!rest.icon && !!label;
|
|
737
758
|
return ((0, react_1.createElement)(Button_1.default, __assign({ fixed: true }, rest, { id: id, key: index, className: className, customTheme: rest.customTheme || theme, intent: intent, tooltip: dropActionLabel ? rest.tooltip || actionLabelTooltip : rest.tooltip, onClick: rest.onClick
|
|
738
759
|
? function (e) {
|
|
739
760
|
var _a;
|
|
@@ -794,14 +815,70 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
794
815
|
* space. Kept as state rather than read during render so the fit is calculated from a width
|
|
795
816
|
* that has actually been laid out.
|
|
796
817
|
*/
|
|
797
|
-
|
|
798
|
-
|
|
818
|
+
/** Whole lines, at least one — a fractional or zero `labelMaxLines` is a caller slip, not
|
|
819
|
+
* a request for half a line of text. */
|
|
820
|
+
var clampLines = Math.max(1, Math.floor(labelMaxLines) || 1);
|
|
821
|
+
/** `compactTitle` drops the description with the title it belongs to, so a bar that has
|
|
822
|
+
* given up its title never grows a row to carry one. */
|
|
823
|
+
var descriptionBelow = descriptionPosition === 'below' && !!description && !(hideTitleForIcon && !!icon);
|
|
824
|
+
var descriptionClamp = Math.max(0, Math.floor(descriptionMaxLines || 0));
|
|
825
|
+
/**
|
|
826
|
+
* A clamped description opens on click so the whole of it can be read — on a phone there is
|
|
827
|
+
* no hover to reveal it with, and two lines of a long sentence are an invitation to tap.
|
|
828
|
+
*
|
|
829
|
+
* Interactive only while it is actually cut, or already open: a description that fits is
|
|
830
|
+
* left alone, so a click on it still reaches the bar and collapses a collapsible panel the
|
|
831
|
+
* way it always has. When it IS cut, that same click must not reach the bar — opening the
|
|
832
|
+
* text and folding the panel away in one gesture is the worst of both.
|
|
833
|
+
*/
|
|
834
|
+
var _10 = (0, react_2.useState)(false), isDescriptionExpanded = _10[0], setIsDescriptionExpanded = _10[1];
|
|
835
|
+
var _11 = (0, react_2.useState)(false), isDescriptionTruncated = _11[0], setIsDescriptionTruncated = _11[1];
|
|
836
|
+
var descriptionRef = (0, react_2.useRef)(null);
|
|
837
|
+
var descriptionIsClamped = descriptionClamp > 0 && !isDescriptionExpanded;
|
|
838
|
+
(0, react_2.useLayoutEffect)(function () {
|
|
839
|
+
var el = descriptionRef.current;
|
|
840
|
+
// `scrollHeight` is what the text wants, `clientHeight` what the clamp left it. Re-read
|
|
841
|
+
// whenever the bar's width moves, because that is what changes how many lines it takes.
|
|
842
|
+
setIsDescriptionTruncated(descriptionIsClamped && !!el && el.scrollHeight > el.clientHeight + 1);
|
|
843
|
+
}, [description, descriptionIsClamped, width]);
|
|
844
|
+
var descriptionIsInteractive = isDescriptionTruncated || isDescriptionExpanded;
|
|
845
|
+
var handleDescriptionClick = (0, react_2.useCallback)(function (event) {
|
|
846
|
+
if (!descriptionIsInteractive) {
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
849
|
+
event.stopPropagation();
|
|
850
|
+
setIsDescriptionExpanded(function (expanded) { return !expanded; });
|
|
851
|
+
}, [descriptionIsInteractive]);
|
|
852
|
+
/** Shared by both places the description can render — inline with the title, or on its
|
|
853
|
+
* own row below — so the two cannot drift apart. */
|
|
854
|
+
var descriptionProps = __assign({ ref: descriptionRef, className: 'reqore-panel-title-description', size: panelSize, effect: __assign({ opacity: 0.7 }, descriptionEffect), intent: descriptionIntent, onClick: handleDescriptionClick }, (descriptionIsInteractive
|
|
855
|
+
? {
|
|
856
|
+
role: 'button',
|
|
857
|
+
tabIndex: 0,
|
|
858
|
+
'aria-expanded': isDescriptionExpanded,
|
|
859
|
+
onKeyDown: function (event) {
|
|
860
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
861
|
+
event.preventDefault();
|
|
862
|
+
handleDescriptionClick(event);
|
|
863
|
+
}
|
|
864
|
+
},
|
|
865
|
+
style: { cursor: 'pointer' },
|
|
866
|
+
}
|
|
867
|
+
: {}));
|
|
868
|
+
var _12 = (0, react_2.useState)(undefined), labelAvailable = _12[0], setLabelAvailable = _12[1];
|
|
869
|
+
var _13 = (0, useFitTextSize_1.useFitTextSize)({
|
|
799
870
|
text: typeof label === 'string' ? label : '',
|
|
800
871
|
available: labelAvailable,
|
|
801
872
|
max: labelNaturalPx,
|
|
802
873
|
min: labelMinTextSize,
|
|
874
|
+
lines: clampLines,
|
|
803
875
|
enabled: fitLabel !== false && typeof label === 'string' && !(labelEffect === null || labelEffect === void 0 ? void 0 : labelEffect.textSize),
|
|
804
|
-
}), labelFitRef =
|
|
876
|
+
}), labelFitRef = _13[0], labelFitPx = _13[1];
|
|
877
|
+
/** Only while the title is actually below its natural size, and never over a caller who
|
|
878
|
+
* pinned the description's own size. */
|
|
879
|
+
var descriptionFontPx = fitLabel && !(descriptionEffect === null || descriptionEffect === void 0 ? void 0 : descriptionEffect.textSize) && labelFitPx < labelNaturalPx
|
|
880
|
+
? Math.max(useFitTextSize_1.FIT_TEXT_FLOOR_PX, Math.round(((_c = sizes_1.TEXT_FROM_SIZE[panelSize]) !== null && _c !== void 0 ? _c : sizes_1.TEXT_FROM_SIZE.normal) * (labelFitPx / labelNaturalPx)))
|
|
881
|
+
: 0;
|
|
805
882
|
/**
|
|
806
883
|
* How much room the title has, computed rather than measured off its own box.
|
|
807
884
|
*
|
|
@@ -819,32 +896,39 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
819
896
|
* Re-run on `width`, which is the bar's own measured width: when the bar resizes, so does
|
|
820
897
|
* everything in it.
|
|
821
898
|
*/
|
|
899
|
+
/**
|
|
900
|
+
* The title's available width is its CONTAINING BLOCK minus whatever shares it — measured,
|
|
901
|
+
* not reconstructed.
|
|
902
|
+
*
|
|
903
|
+
* This used to subtract the action group, the gaps and the icon from the bar's width. That
|
|
904
|
+
* arithmetic held only for the one layout it was written against: give the panel a
|
|
905
|
+
* `description` and the icon moves into an outer grid, so the sum over-reported by 30-80px
|
|
906
|
+
* and the fit under-shrank. The symptom was the worst of both worlds — a title both smaller
|
|
907
|
+
* AND ellipsized, which is the one outcome the feature exists to avoid.
|
|
908
|
+
*
|
|
909
|
+
* Measuring the parent is safe precisely where it looks circular. While the text overflows
|
|
910
|
+
* — the only regime in which anything shrinks — the parent is pinned by the row, not by the
|
|
911
|
+
* text: at a 300px bar it measures 128px at 19px, at 16px, and wrapped to two lines. When
|
|
912
|
+
* the text does fit, the parent has slack and the fit returns the natural size, which is
|
|
913
|
+
* the right answer either way.
|
|
914
|
+
*/
|
|
822
915
|
(0, react_2.useLayoutEffect)(function () {
|
|
823
916
|
var node = labelFitRef.current;
|
|
824
|
-
var
|
|
825
|
-
|
|
826
|
-
if (!fitLabel || !node || !bar || !header) {
|
|
917
|
+
var parent = node === null || node === void 0 ? void 0 : node.parentElement;
|
|
918
|
+
if (!fitLabel || !node || !parent) {
|
|
827
919
|
return;
|
|
828
920
|
}
|
|
829
|
-
var
|
|
830
|
-
var
|
|
831
|
-
var
|
|
832
|
-
//
|
|
833
|
-
var
|
|
834
|
-
return child ===
|
|
835
|
-
}, 0);
|
|
836
|
-
var barGaps = barGap * Math.max(0, bar.children.length - 1);
|
|
837
|
-
// …and everything inside the header that is not the title itself: the icon, the badge,
|
|
838
|
-
// and the description column's gap.
|
|
839
|
-
var insideHeader = Array.from(header.querySelectorAll(':scope *')).reduce(function (total, child) {
|
|
840
|
-
var el = child;
|
|
841
|
-
return el === node || node.contains(el) || el.contains(node)
|
|
842
|
-
? total
|
|
843
|
-
: total + (el.parentElement === node.parentElement ? el.getBoundingClientRect().width : 0);
|
|
921
|
+
var style = getComputedStyle(parent);
|
|
922
|
+
var padding = (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0);
|
|
923
|
+
var gap = parseFloat(style.columnGap) || parseFloat(style.gap) || 0;
|
|
924
|
+
// A badge sits beside the title in the same box and takes real width.
|
|
925
|
+
var siblings = Array.from(parent.children).reduce(function (total, child) {
|
|
926
|
+
return child === node ? total : total + child.getBoundingClientRect().width;
|
|
844
927
|
}, 0);
|
|
845
|
-
var
|
|
928
|
+
var gaps = gap * Math.max(0, parent.children.length - 1);
|
|
929
|
+
var next = Math.max(0, Math.round(parent.clientWidth - padding - siblings - gaps));
|
|
846
930
|
setLabelAvailable(function (current) { return (current === next ? current : next); });
|
|
847
|
-
}, [fitLabel, label, width,
|
|
931
|
+
}, [fitLabel, label, width, badge, actions, panelSize, description, clampLines]);
|
|
848
932
|
var iconTooltip = (0, react_2.useMemo)(function () { return ({
|
|
849
933
|
content: label,
|
|
850
934
|
}); }, [label]);
|
|
@@ -863,7 +947,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
863
947
|
panelRef.current = node;
|
|
864
948
|
}, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [rest.stickyHeader ? ((0, jsx_runtime_1.jsx)("div", { ref: stickySentinelRef, "aria-hidden": 'true', style: { height: 0 } })) : null, _isHovered &&
|
|
865
949
|
(0, lodash_1.size)(floatingActionsList) > 0 &&
|
|
866
|
-
(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, "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, 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 () {
|
|
950
|
+
(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, 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 () {
|
|
867
951
|
var hasPanelIcon = !!icon || !!iconImage || loading;
|
|
868
952
|
// The icon takes the label's place, so there has to BE an icon. Without one
|
|
869
953
|
// the label is the only thing identifying the panel and it stays put — a
|
|
@@ -904,17 +988,17 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
904
988
|
// the inline-flex heading: a block wrapper adds the row's leading on
|
|
905
989
|
// top of the heading's own box, which made a `tiny` panel 3px taller
|
|
906
990
|
// than it was before this wrapper existed.
|
|
907
|
-
(0, jsx_runtime_1.jsx)(
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
991
|
+
(0, jsx_runtime_1.jsx)(StyledPanelTitleLabelBox, { ref: labelFitRef, className: 'reqore-panel-title-label-box', "$clampLines": clampLines, children: (0, jsx_runtime_1.jsx)(LabelEditor_1.LabelEditor, { size: labelSize || panelSize, customTheme: theme, effect: __assign({
|
|
992
|
+
// `noWrap` pins the heading to one line; a clamped title is
|
|
993
|
+
// allowed to wrap, and the clamp brings its own ellipsis.
|
|
994
|
+
noWrap: clampLines === 1 }, labelEffect), style: __assign(__assign(__assign({}, (clampLines > 1
|
|
995
|
+
? {}
|
|
996
|
+
: { display: 'inline-flex', alignItems: 'center' })), { minWidth: 0,
|
|
913
997
|
// Capped to the measured wrapper so the heading's own
|
|
914
998
|
// `text-overflow: ellipsis` (from `noWrap`) has a box to overflow.
|
|
915
999
|
// An `inline-flex` heading otherwise sizes to its text, and the
|
|
916
1000
|
// wrapper clips it mid-word with no ellipsis at all.
|
|
917
|
-
maxWidth: '100%' }, (fitLabel !== false && !(labelEffect === null || labelEffect === void 0 ? void 0 : labelEffect.textSize)
|
|
1001
|
+
maxWidth: '100%' }), (fitLabel !== false && !(labelEffect === null || labelEffect === void 0 ? void 0 : labelEffect.textSize)
|
|
918
1002
|
? { fontSize: "".concat(labelFitPx, "px") }
|
|
919
1003
|
: {})), label: label, onSubmit: onLabelEdit, tooltip: showLabelTooltip ? customLabelTooltip || label : undefined }) })) : (label), badge || badge === 0 ? ((0, jsx_runtime_1.jsx)(Button_1.ButtonBadge, { size: (0, utils_1.getOneHigherSize)(panelSize), content: badge, wrapGroup: isSmall, margin: label ? 'left' : 'none' })) : null] }));
|
|
920
1004
|
// Description size is driven by the panel size only —
|
|
@@ -925,7 +1009,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
925
1009
|
// pairing: a bigger label should not make supporting
|
|
926
1010
|
// text smaller. Consumers that want to size the
|
|
927
1011
|
// description explicitly pass `descriptionEffect.textSize`.
|
|
928
|
-
var descriptionRow = description && !hideTitleText ? ((0, jsx_runtime_1.jsx)(Span_1.ReqoreSpan,
|
|
1012
|
+
var descriptionRow = description && !hideTitleText && !descriptionBelow ? ((0, jsx_runtime_1.jsx)(Span_1.ReqoreSpan, __assign({}, descriptionProps, { children: description }))) : null;
|
|
929
1013
|
return ((0, jsx_runtime_1.jsx)(exports.StyledPanelTitleHeaderContent, __assign({ size: panelSize }, labelProps, { hasLabel: !!label && !hideTitleText, hasIcon: useOuterGrid, iconSize: sizes_1.ICON_FROM_HEADER_SIZE[labelSize || sizes_1.HEADER_SIZE_TO_NUMBER[panelSize]], "$hasOuterIcon": useOuterGrid, "$iconVerticalAlign": iconVerticalAlign, "$hasDescription": !!description && !hideTitleText, children: useOuterGrid ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [panelIcon, labelRow, descriptionRow] })) : ((0, jsx_runtime_1.jsxs)(exports.StyledPanelTitleHeaderLabelAndDescription, { children: [labelRow, descriptionRow] })) })));
|
|
930
1014
|
})()) : null, breadcrumbs && (badge || badge === 0) ? ((0, jsx_runtime_1.jsx)(Button_1.ButtonBadge, { size: (0, utils_1.getOneHigherSize)(panelSize), content: badge, wrapGroup: isSmall, margin: label ? 'left' : 'none' })) : null, (0, jsx_runtime_1.jsx)(NonResponsiveActions_1.ReqorePanelNonResponsiveActions
|
|
931
1015
|
// The narrow bar keeps its controls in the trailing group, so this row —
|
|
@@ -933,15 +1017,47 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
933
1017
|
, {
|
|
934
1018
|
// The narrow bar keeps its controls in the trailing group, so this row —
|
|
935
1019
|
// which existed only for the stacked layout — never shows.
|
|
936
|
-
show: false, isSmall: false, showControlButtons: true, size:
|
|
937
|
-
//
|
|
938
|
-
//
|
|
939
|
-
//
|
|
940
|
-
//
|
|
941
|
-
//
|
|
942
|
-
//
|
|
943
|
-
//
|
|
944
|
-
|
|
1020
|
+
show: false, isSmall: false, showControlButtons: true, size: panelSize, hasResponsiveActions: hasResponsiveActions(nonFloatingActions), customTheme: theme, isCollapsed: _isCollapsed, onCollapseClick: collapsible ? handleCollapseClick : undefined, onCloseClick: onClose, closeButtonProps: closeButtonProps, collapseButtonProps: collapseButtonProps, collapseTooltip: collapseTooltip, expandTooltip: expandTooltip, closeTooltip: closeTooltip, fluid: false, style: { marginLeft: 'auto' } })] })), hasResponsiveActions(nonFloatingActions) && ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, __assign({ responsive: responsiveActions,
|
|
1021
|
+
// Not fluid by default. `fluid` emits `width: 100%`, so the group's flex basis
|
|
1022
|
+
// becomes the whole bar and the title — the only shrinkable thing on the other
|
|
1023
|
+
// side — collapses to nothing: measured at 0px of title on a 400px panel, and
|
|
1024
|
+
// 142px of a 518px bar where the buttons needed 90.
|
|
1025
|
+
//
|
|
1026
|
+
// A caller whose actions include something with no useful width of its own —
|
|
1027
|
+
// Collection puts a search input in here — opts back in through
|
|
1028
|
+
// `responsiveActionsWrapperProps`, because `fluid` is also what ControlGroup
|
|
1029
|
+
// propagates to its children, and that input has nothing to fill without it.
|
|
1030
|
+
fluid: false, horizontalAlign: 'flex-end', customTheme: theme, size: panelSize }, responsiveActionsWrapperProps, {
|
|
1031
|
+
// The cap is the whole fix. Half the bar guarantees the title the other half,
|
|
1032
|
+
// and the moment the buttons need more than their share the group overflows —
|
|
1033
|
+
// which is what `responsive` collapse watches (`scrollWidth > clientWidth`), so
|
|
1034
|
+
// the fold into the `…` menu still fires. Floored at 40px because shrinking to
|
|
1035
|
+
// nothing clips the buttons rather than folding them, and ControlGroup ignores
|
|
1036
|
+
// its own overflow below that width, which would strand them clipped.
|
|
1037
|
+
style: __assign({
|
|
1038
|
+
// Pushed to the trailing edge. A `fluid` group used to span the bar and its
|
|
1039
|
+
// own `horizontalAlign` put the buttons on the right; a content-sized one is
|
|
1040
|
+
// only as wide as its buttons, so with no title header beside it — Tree has
|
|
1041
|
+
// no label — it would sit at the LEFT of an otherwise empty bar. `auto`
|
|
1042
|
+
// margin restores the edge without giving the group any width back.
|
|
1043
|
+
marginLeft: 'auto',
|
|
1044
|
+
// Content basis that may still shrink. `fluid={false}` alone compiles to
|
|
1045
|
+
// `flex: 0 0 auto`, which pins the group at its content width so it can never
|
|
1046
|
+
// overflow — and `responsive` collapse watches `scrollWidth > clientWidth`,
|
|
1047
|
+
// so the fold into the `…` menu would simply stop happening.
|
|
1048
|
+
flex: '0 1 auto',
|
|
1049
|
+
// Floored, because shrinking to nothing clips the buttons instead of folding
|
|
1050
|
+
// them, and ControlGroup ignores its own overflow below 40px.
|
|
1051
|
+
minWidth: 40,
|
|
1052
|
+
// Capped, so a group that IS opted back into growing cannot take the row —
|
|
1053
|
+
// but only while there is a title header to take it FROM. With no label,
|
|
1054
|
+
// badge, icon or breadcrumbs the bar is the group's alone, and holding a
|
|
1055
|
+
// Collection's search input to half of an empty bar guards nothing.
|
|
1056
|
+
maxWidth: hasTitleHeader ? '50%' : undefined }, responsiveActionsWrapperProps === null || responsiveActionsWrapperProps === void 0 ? void 0 : responsiveActionsWrapperProps.style), children: nonFloatingActions.map(renderResponsiveActions()) }))), (0, jsx_runtime_1.jsx)(NonResponsiveActions_1.ReqorePanelNonResponsiveActions, { show: showNonResponsiveGroup(), isSmall: false, showControlButtons: true, size: panelSize, hasResponsiveActions: hasResponsiveActions(nonFloatingActions), customTheme: theme, isCollapsed: _isCollapsed, onCollapseClick: collapsible ? handleCollapseClick : undefined, onCloseClick: onClose, closeButtonProps: closeButtonProps, collapseButtonProps: collapseButtonProps, collapseTooltip: collapseTooltip, expandTooltip: expandTooltip, closeTooltip: closeTooltip, fluid: !hasTitleHeader, children: nonFloatingActions.map(renderNonResponsiveActions()) }), descriptionBelow ? (
|
|
1057
|
+
// `flex-basis: 100%` is what puts it on its own line — the bar is a wrapping
|
|
1058
|
+
// flex row, so a full-width item cannot share one with anything before it.
|
|
1059
|
+
// `min-width: 0` so a long sentence wraps inside the bar instead of widening it.
|
|
1060
|
+
(0, jsx_runtime_1.jsx)("div", { className: 'reqore-panel-title-description-row', style: { flex: '0 0 100%', minWidth: 0 }, children: (0, jsx_runtime_1.jsx)(Span_1.ReqoreSpan, __assign({}, descriptionProps, { children: description })) })) : null] })), !_isCollapsed || (_isCollapsed && !unMountContentOnCollapse) ? ((0, jsx_runtime_1.jsx)(exports.StyledPanelContent, { as: 'div', className: 'reqore-panel-content', hasLabel: !!hasTitleBar, hasBottomActions: hasBottomActions, isCollapsed: _isCollapsed, style: contentStyle, padded: padded, minimal: minimal || opacity === 0, size: contentSize || panelSize, ref: getContentRef, noHorizontalPadding: noHorizontalPadding, children: 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] })) })));
|
|
945
1061
|
});
|
|
946
|
-
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;
|
|
1062
|
+
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;
|
|
947
1063
|
//# sourceMappingURL=index.js.map
|