@qoretechnologies/reqore 0.78.11-pr.723.g4423093 → 0.78.11
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 +14 -60
- package/dist/components/Accordion/index.js.map +1 -1
- package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/index.js +21 -58
- package/dist/components/Breadcrumbs/index.js.map +1 -1
- package/dist/components/Bubble/index.d.ts.map +1 -1
- package/dist/components/Bubble/index.js +4 -13
- package/dist/components/Bubble/index.js.map +1 -1
- package/dist/components/Button/index.d.ts +0 -67
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +98 -238
- 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 +29 -49
- 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 +36 -112
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/CollapsibleContent/index.d.ts.map +1 -1
- package/dist/components/CollapsibleContent/index.js +2 -6
- package/dist/components/CollapsibleContent/index.js.map +1 -1
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +1 -22
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/DataView/index.d.ts.map +1 -1
- package/dist/components/DataView/index.js +10 -13
- package/dist/components/DataView/index.js.map +1 -1
- package/dist/components/DescriptionList/index.d.ts.map +1 -1
- package/dist/components/DescriptionList/index.js +4 -30
- package/dist/components/DescriptionList/index.js.map +1 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +25 -41
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Dropdown/list.js +14 -19
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Effect/index.d.ts +0 -37
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js +58 -224
- 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 +59 -98
- 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 +21 -54
- 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 +4 -7
- 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 +3 -13
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Input/index.d.ts +1 -44
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +23 -89
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InputClearButton/index.d.ts +2 -7
- package/dist/components/InputClearButton/index.d.ts.map +1 -1
- package/dist/components/InputClearButton/index.js +5 -12
- package/dist/components/InputClearButton/index.js.map +1 -1
- package/dist/components/InternalPopover/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.js +10 -19
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/Link/index.d.ts.map +1 -1
- package/dist/components/Link/index.js +1 -6
- package/dist/components/Link/index.js.map +1 -1
- package/dist/components/Menu/divider.d.ts.map +1 -1
- package/dist/components/Menu/divider.js +3 -8
- package/dist/components/Menu/divider.js.map +1 -1
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +4 -17
- 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 +4 -20
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/NavRail/index.d.ts +0 -2
- package/dist/components/NavRail/index.d.ts.map +1 -1
- package/dist/components/NavRail/index.js +40 -120
- package/dist/components/NavRail/index.js.map +1 -1
- package/dist/components/Notifications/notification.d.ts +2 -6
- package/dist/components/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +18 -78
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Notifications/styles.d.ts +0 -20
- package/dist/components/Notifications/styles.d.ts.map +1 -1
- package/dist/components/Notifications/styles.js +9 -37
- package/dist/components/Notifications/styles.js.map +1 -1
- package/dist/components/Panel/index.d.ts +0 -3
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +153 -214
- 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 +5 -8
- 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 +1 -1
- 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 +8 -20
- package/dist/components/Rating/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts +5 -0
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +52 -90
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/SegmentedControl/index.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index.js +42 -87
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/SeverityRow/index.d.ts.map +1 -1
- package/dist/components/SeverityRow/index.js +1 -1
- package/dist/components/SeverityRow/index.js.map +1 -1
- package/dist/components/Span/index.d.ts.map +1 -1
- package/dist/components/Span/index.js +5 -8
- 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 +12 -42
- package/dist/components/StackedBar/index.js.map +1 -1
- package/dist/components/Statistic/index.d.ts.map +1 -1
- package/dist/components/Statistic/index.js +6 -34
- package/dist/components/Statistic/index.js.map +1 -1
- package/dist/components/Table/cell.d.ts.map +1 -1
- package/dist/components/Table/cell.js +41 -72
- package/dist/components/Table/cell.js.map +1 -1
- package/dist/components/Table/headerCell.d.ts.map +1 -1
- package/dist/components/Table/headerCell.js +5 -7
- package/dist/components/Table/headerCell.js.map +1 -1
- package/dist/components/Tag/index.d.ts +3 -70
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +67 -233
- 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 +20 -35
- package/dist/components/Testimonial/index.js.map +1 -1
- package/dist/components/Textarea/index.d.ts +0 -6
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +20 -20
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/components/Timeline/index.d.ts +0 -2
- package/dist/components/Timeline/index.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +13 -56
- package/dist/components/Timeline/index.js.map +1 -1
- package/dist/components/Tree/index.d.ts.map +1 -1
- package/dist/components/Tree/index.js +20 -24
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/containers/UIProvider.d.ts +0 -10
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +4 -33
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/helpers/colors.d.ts +2 -184
- package/dist/helpers/colors.d.ts.map +1 -1
- package/dist/helpers/colors.js +86 -739
- package/dist/helpers/colors.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
- package/tests.json +1 -0
- package/vitest.config.ts +0 -10
- package/dist/context/SurfaceContext.d.ts +0 -18
- package/dist/context/SurfaceContext.d.ts.map +0 -1
- package/dist/context/SurfaceContext.js +0 -39
- package/dist/context/SurfaceContext.js.map +0 -1
- package/dist/helpers/iconProps.d.ts +0 -14
- package/dist/helpers/iconProps.d.ts.map +0 -1
- package/dist/helpers/iconProps.js +0 -33
- package/dist/helpers/iconProps.js.map +0 -1
- package/dist/helpers/surface.d.ts +0 -31
- package/dist/helpers/surface.d.ts.map +0 -1
- package/dist/helpers/surface.js +0 -87
- package/dist/helpers/surface.js.map +0 -1
- package/dist/hooks/useDrawnSurface.d.ts +0 -38
- package/dist/hooks/useDrawnSurface.d.ts.map +0 -1
- package/dist/hooks/useDrawnSurface.js +0 -48
- package/dist/hooks/useDrawnSurface.js.map +0 -1
|
@@ -86,11 +86,9 @@ var styled_components_1 = require("styled-components");
|
|
|
86
86
|
var colors_1 = require("../../constants/colors");
|
|
87
87
|
var sizes_1 = require("../../constants/sizes");
|
|
88
88
|
var colors_2 = require("../../helpers/colors");
|
|
89
|
-
var SurfaceContext_1 = require("../../context/SurfaceContext");
|
|
90
89
|
var styled_1 = __importStar(require("../../helpers/styled"));
|
|
91
90
|
var utils_1 = require("../../helpers/utils");
|
|
92
91
|
var hoveringPointer_1 = require("../../helpers/hoveringPointer");
|
|
93
|
-
var iconProps_1 = require("../../helpers/iconProps");
|
|
94
92
|
var useCombinedRefs_1 = require("../../hooks/useCombinedRefs");
|
|
95
93
|
var useReqoreContext_1 = require("../../hooks/useReqoreContext");
|
|
96
94
|
var useFitTextSize_1 = require("../../hooks/useFitTextSize");
|
|
@@ -109,7 +107,6 @@ var Span_1 = require("../Span");
|
|
|
109
107
|
var TooltipComponent_1 = require("../TooltipComponent");
|
|
110
108
|
var LabelEditor_1 = require("./LabelEditor");
|
|
111
109
|
var NonResponsiveActions_1 = require("./NonResponsiveActions");
|
|
112
|
-
var surface_1 = require("../../helpers/surface");
|
|
113
110
|
var getPaddingSize = function (padded, size) {
|
|
114
111
|
return typeof padded === 'string' ? sizes_1.SPECIAL_PADDING_FROM_SIZE[padded] : sizes_1.PADDING_FROM_SIZE[size];
|
|
115
112
|
};
|
|
@@ -195,7 +192,7 @@ var getWidthAboveMinimum = function (element) {
|
|
|
195
192
|
return Math.max(0, width - minimum);
|
|
196
193
|
};
|
|
197
194
|
exports.StyledPanelTitleHeader = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\n display: flex;\n justify-content: flex-start;\n align-items: center;\n /* A CONTENT basis, and both extremes were tried before settling here. Basis 0 hands the action\n group beside this one its full content width, so nothing ever overflows and the fold into the\n menu never fires \u2014 actions labelled \"hidden when small\" stay visible on a small panel. A 100%\n width does the opposite: this header claims the entire row, so the group is always crushed to\n its floor and always folds however much room there is, which hid Tree's save button behind an\n overflow menu on a panel with space to spare. On a content basis the two shrink against each\n other in proportion to what they each need, which is the only version where folding means\n \"there is no room\" rather than \"there is a header\". */\n flex: 1 1 auto;\n overflow: hidden;\n"], ["\n\n display: flex;\n justify-content: flex-start;\n align-items: center;\n /* A CONTENT basis, and both extremes were tried before settling here. Basis 0 hands the action\n group beside this one its full content width, so nothing ever overflows and the fold into the\n menu never fires \u2014 actions labelled \"hidden when small\" stay visible on a small panel. A 100%\n width does the opposite: this header claims the entire row, so the group is always crushed to\n its floor and always folds however much room there is, which hid Tree's save button behind an\n overflow menu on a panel with space to spare. On a content basis the two shrink against each\n other in proportion to what they each need, which is the only version where folding means\n \"there is no room\" rather than \"there is a header\". */\n flex: 1 1 auto;\n overflow: hidden;\n"])));
|
|
198
|
-
exports.StyledPanelTitleHeaderContent = styled_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n // When the icon lives in the outer container (iconVerticalAlign mode),\n // we use a 2-column \u00D7 N-row CSS Grid where the LABEL ROW and DESCRIPTION\n // ROW are direct grid items \u2014 not wrapped inside a span-2 stack. That\n // makes each row's auto-sized height equal to the actual text row's\n // line-box height, so 'align-self: center' on the icon (in column 1)\n // visually centres the icon against the text row it shares a grid row\n // with \u2014 no font-metric guesswork.\n display: ", ";\n
|
|
195
|
+
exports.StyledPanelTitleHeaderContent = styled_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n // When the icon lives in the outer container (iconVerticalAlign mode),\n // we use a 2-column \u00D7 N-row CSS Grid where the LABEL ROW and DESCRIPTION\n // ROW are direct grid items \u2014 not wrapped inside a span-2 stack. That\n // makes each row's auto-sized height equal to the actual text row's\n // line-box height, so 'align-self: center' on the icon (in column 1)\n // visually centres the icon against the text row it shares a grid row\n // with \u2014 no font-metric guesswork.\n display: ", ";\n ", "\n flex: 0 1 auto;\n overflow: hidden;\n min-width: ", "px;\n"], ["\n // When the icon lives in the outer container (iconVerticalAlign mode),\n // we use a 2-column \u00D7 N-row CSS Grid where the LABEL ROW and DESCRIPTION\n // ROW are direct grid items \u2014 not wrapped inside a span-2 stack. That\n // makes each row's auto-sized height equal to the actual text row's\n // line-box height, so 'align-self: center' on the icon (in column 1)\n // visually centres the icon against the text row it shares a grid row\n // with \u2014 no font-metric guesswork.\n display: ", ";\n ", "\n flex: 0 1 auto;\n overflow: hidden;\n min-width: ", "px;\n"])), function (_a) {
|
|
199
196
|
var $hasOuterIcon = _a.$hasOuterIcon;
|
|
200
197
|
return ($hasOuterIcon ? 'grid' : 'flex');
|
|
201
198
|
}, function (_a) {
|
|
@@ -328,14 +325,6 @@ exports.REQORE_PANEL_STYLE_PROPS = (0, styled_1.listReqoreStyleProps)({
|
|
|
328
325
|
unMountContentOnCollapse: true,
|
|
329
326
|
wrapperPadding: true,
|
|
330
327
|
});
|
|
331
|
-
/** A panel's fill at `opacity`: what its styled rule paints and what it hands what it holds as its surface. */
|
|
332
|
-
var getPanelFill = function (theme, opacity) {
|
|
333
|
-
return (0, colors_2.fadeColor)((0, colors_2.changeDarkness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity);
|
|
334
|
-
};
|
|
335
|
-
/** A panel's title and top bar fill at `opacity`, painted and handed down alike. */
|
|
336
|
-
var getPanelBarFill = function (theme, opacity) {
|
|
337
|
-
return (0, colors_2.fadeColor)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity);
|
|
338
|
-
};
|
|
339
328
|
exports.StyledPanel = (0, styled_1.default)(Effect_1.StyledEffect).withConfig({
|
|
340
329
|
// Its own props, `interactive` (set by the panel for its hover styles) and the layout flags a
|
|
341
330
|
// containing ControlGroup hands it — except `size`, which a panel never forwards but a
|
|
@@ -343,7 +332,7 @@ exports.StyledPanel = (0, styled_1.default)(Effect_1.StyledEffect).withConfig({
|
|
|
343
332
|
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)),
|
|
344
333
|
})(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) {
|
|
345
334
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
346
|
-
return
|
|
335
|
+
return (0, polished_1.rgba)((0, colors_2.changeDarkness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity);
|
|
347
336
|
}, function (_a) {
|
|
348
337
|
var rounded = _a.rounded, radiusSize = _a.radiusSize;
|
|
349
338
|
return rounded ? (0, sizes_1.resolveRadius)('normal', radiusSize) : 0;
|
|
@@ -353,8 +342,8 @@ exports.StyledPanel = (0, styled_1.default)(Effect_1.StyledEffect).withConfig({
|
|
|
353
342
|
? "1px solid ".concat((0, colors_2.changeLightness)(getPanelBorderBaseColor(theme, { intent: intent, accentPosition: accentPosition }), 0.08))
|
|
354
343
|
: undefined;
|
|
355
344
|
}, function (_a) {
|
|
356
|
-
var theme = _a.theme
|
|
357
|
-
return
|
|
345
|
+
var theme = _a.theme;
|
|
346
|
+
return (0, colors_2.getReadableColor)(theme, undefined, undefined, true);
|
|
358
347
|
}, function (_a) {
|
|
359
348
|
var accentPosition = _a.accentPosition, _b = _a.$accentSize, $accentSize = _b === void 0 ? sizes_1.ACCENT_SIZE_TO_PX.normal : _b, theme = _a.theme, intent = _a.intent, flat = _a.flat, rounded = _a.rounded, radiusSize = _a.radiusSize, stickyHeader = _a.stickyHeader;
|
|
360
349
|
if (!accentPosition) {
|
|
@@ -398,9 +387,9 @@ exports.StyledPanel = (0, styled_1.default)(Effect_1.StyledEffect).withConfig({
|
|
|
398
387
|
return interactive
|
|
399
388
|
? (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
|
|
400
389
|
? undefined
|
|
401
|
-
: (0,
|
|
390
|
+
: (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 })
|
|
402
391
|
? (0, colors_2.changeLightness)(getPanelBorderBaseColor(theme, { intent: intent, accentPosition: accentPosition }), 0.25)
|
|
403
|
-
: undefined, opacity !== 0 && (0, styled_components_1.css)(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n ", ":after {\n background: linear-gradient(\n to top,\n ", "\n 0%,\n transparent 100%\n );\n }\n "], ["\n ", ":after {\n background: linear-gradient(\n to top,\n ", "\n 0%,\n transparent 100%\n );\n }\n "])), item_1.StyledCollectionItemContent, (0,
|
|
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.changeDarkness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity)), opacity))) : undefined;
|
|
404
393
|
}, function (_a) {
|
|
405
394
|
var raised = _a.raised, flat = _a.flat, intent = _a.intent, accentPosition = _a.accentPosition;
|
|
406
395
|
return raised && !hasPanelBorder({ flat: flat, intent: intent, accentPosition: accentPosition }) && styles_1.RaisedElement;
|
|
@@ -428,26 +417,23 @@ exports.StyledPanelTitle = styled_1.default.div.withConfig({
|
|
|
428
417
|
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);
|
|
429
418
|
}, function (_a) {
|
|
430
419
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
431
|
-
return
|
|
420
|
+
return (0, polished_1.rgba)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity);
|
|
432
421
|
}, function (_a) {
|
|
433
422
|
var noHorizontalPadding = _a.noHorizontalPadding, size = _a.size, padded = _a.padded, opacity = _a.opacity, flat = _a.flat, intent = _a.intent;
|
|
434
423
|
return "".concat(opacity === 0 && flat && !intent ? 0 : getPaddingSize(padded, size), "px ").concat(noHorizontalPadding ? 0 : "".concat(getPaddingSize(padded, size), "px"));
|
|
435
424
|
}, function (_a) {
|
|
436
425
|
var theme = _a.theme, isCollapsed = _a.isCollapsed, flat = _a.flat, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
437
426
|
return !isCollapsed && !flat && opacity
|
|
438
|
-
? "1px solid ".concat((0,
|
|
427
|
+
? "1px solid ".concat((0, polished_1.rgba)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.08), opacity))
|
|
439
428
|
: null;
|
|
440
429
|
}, sizes_1.GAP_FROM_SIZE.normal, exports.StyledPanelTitleHeaderContent, styles_1.INACTIVE_ICON_SCALE, function (_a) {
|
|
441
430
|
var collapsible = _a.collapsible;
|
|
442
431
|
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) {
|
|
443
432
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
444
|
-
return (0,
|
|
433
|
+
return (0, polished_1.rgba)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.05), opacity);
|
|
445
434
|
});
|
|
446
435
|
});
|
|
447
|
-
exports.StyledPanelTopBar = (0, styled_1.default)(exports.StyledPanelTitle)(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n
|
|
448
|
-
var $color = _a.$color;
|
|
449
|
-
return $color;
|
|
450
|
-
}, function (_a) {
|
|
436
|
+
exports.StyledPanelTopBar = (0, styled_1.default)(exports.StyledPanelTitle)(templateObject_27 || (templateObject_27 = __makeTemplateObject(["\n padding-bottom: ", ";\n padding-top: ", ";\n position: ", ";\n /* `top: 0` must mean \"flush with the visible top edge of whatever scrolls\",\n which is what every call site assumes. Sticky resolves against the scroll\n container's CONTENT box, so on a padded scrollport \u2014 which every default\n panel/drawer/modal body is, since StyledPanelContent puts padding and\n overflow on one element \u2014 an uncompensated 0 parks the header below the\n padding and lets content scroll through the gap. `stickyHeaderInset` is\n that padding, measured from the real scroll ancestor at runtime;\n `stickyHeaderOffset` stays a deliberate caller offset on top of a now\n correct zero. */\n top: ", ";\n z-index: ", ";\n // A sticky header forces the panel wrapper to overflow visible (so the\n // header can stick), which stops the wrapper from clipping the header's top\n // corners \u2014 so without this the panel reads as square-topped even at rest.\n // AT REST, round the header's own top corners to the panel's inner radius so\n // the panel keeps its radius (inset 1px past a visible border to match the\n // wrapper's inner curve; flat border-less panels need no inset). ONCE STUCK\n // (pinned to the scroll container, detected at runtime via isStuck), drop the\n // radius to 0 so the pinned header reads as a full-width bar and only loses\n // its corners while it is actually moving with the scroll.\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n background: ", ";\n // When the header is sticky AND the panel is minimal / transparent (opacity === 0), the\n // header has no surface of its own \u2014 scrolling content slides straight under it and the\n // label / actions become illegible. Apply a backdrop blur so the underlying content stays\n // visible but is softened enough for the header text to read clearly. Idle (no overflow,\n // nothing behind) the blur is a no-op so the static appearance is unchanged.\n ", "\n"], ["\n padding-bottom: ", ";\n padding-top: ", ";\n position: ", ";\n /* \\`top: 0\\` must mean \"flush with the visible top edge of whatever scrolls\",\n which is what every call site assumes. Sticky resolves against the scroll\n container's CONTENT box, so on a padded scrollport \u2014 which every default\n panel/drawer/modal body is, since StyledPanelContent puts padding and\n overflow on one element \u2014 an uncompensated 0 parks the header below the\n padding and lets content scroll through the gap. \\`stickyHeaderInset\\` is\n that padding, measured from the real scroll ancestor at runtime;\n \\`stickyHeaderOffset\\` stays a deliberate caller offset on top of a now\n correct zero. */\n top: ", ";\n z-index: ", ";\n // A sticky header forces the panel wrapper to overflow visible (so the\n // header can stick), which stops the wrapper from clipping the header's top\n // corners \u2014 so without this the panel reads as square-topped even at rest.\n // AT REST, round the header's own top corners to the panel's inner radius so\n // the panel keeps its radius (inset 1px past a visible border to match the\n // wrapper's inner curve; flat border-less panels need no inset). ONCE STUCK\n // (pinned to the scroll container, detected at runtime via isStuck), drop the\n // radius to 0 so the pinned header reads as a full-width bar and only loses\n // its corners while it is actually moving with the scroll.\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n background: ", ";\n // When the header is sticky AND the panel is minimal / transparent (opacity === 0), the\n // header has no surface of its own \u2014 scrolling content slides straight under it and the\n // label / actions become illegible. Apply a backdrop blur so the underlying content stays\n // visible but is softened enough for the header text to read clearly. Idle (no overflow,\n // nothing behind) the blur is a no-op so the static appearance is unchanged.\n ", "\n"])), function (_a) {
|
|
451
437
|
var padded = _a.padded, size = _a.size, isCollapsed = _a.isCollapsed, minimal = _a.minimal;
|
|
452
438
|
return !padded || isCollapsed || !minimal
|
|
453
439
|
? "".concat(getPaddingSize(padded, size), "px")
|
|
@@ -488,7 +474,7 @@ exports.StyledPanelTopBar = (0, styled_1.default)(exports.StyledPanelTitle)(temp
|
|
|
488
474
|
: undefined;
|
|
489
475
|
}, function (_a) {
|
|
490
476
|
var theme = _a.theme, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
491
|
-
return
|
|
477
|
+
return (0, polished_1.rgba)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.03), opacity);
|
|
492
478
|
}, function (_a) {
|
|
493
479
|
var stickyHeader = _a.stickyHeader, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
494
480
|
return stickyHeader &&
|
|
@@ -511,7 +497,7 @@ exports.StyledPanelBottomActions = (0, styled_1.default)(exports.StyledPanelTitl
|
|
|
511
497
|
}, function (_a) {
|
|
512
498
|
var theme = _a.theme, flat = _a.flat, _b = _a.opacity, opacity = _b === void 0 ? 1 : _b;
|
|
513
499
|
return !flat
|
|
514
|
-
? "1px solid ".concat((0,
|
|
500
|
+
? "1px solid ".concat((0, polished_1.rgba)((0, colors_2.changeLightness)((0, colors_2.getMainBackgroundColor)(theme), 0.08), opacity))
|
|
515
501
|
: null;
|
|
516
502
|
});
|
|
517
503
|
exports.StyledPanelContent = styled_1.default.div(templateObject_29 || (templateObject_29 = __makeTemplateObject(["\n display: ", ";\n padding: ", ";\n flex: 1;\n /* A flex child's min-height defaults to its content size, so without this the\n scrollable content can't shrink: a panel/drawer body taller than the panel\n pushes the (flex: 0 0 auto) bottom-actions footer past the panel's clipped\n edge and strands it, instead of scrolling. */\n min-height: 0;\n overflow: auto;\n overflow-wrap: anywhere;\n font-size: ", "px;\n /* 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 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 /* 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) {
|
|
@@ -569,15 +555,13 @@ exports.ReqorePanelSkeleton = (0, react_2.memo)(function (_a) {
|
|
|
569
555
|
return ((0, jsx_runtime_1.jsxs)(ControlGroup_1.default, { vertical: true, fluid: true, gapSize: 'big', style: style, children: [(0, jsx_runtime_1.jsxs)(ControlGroup_1.default, { spaceBetween: true, fluid: true, children: [(0, jsx_runtime_1.jsxs)(ControlGroup_1.default, { fixed: true, gapSize: 'big', children: [(0, jsx_runtime_1.jsx)(Skeleton_1.ReqoreSkeleton, { circle: true, size: size }), (0, jsx_runtime_1.jsx)(Skeleton_1.ReqoreSkeleton, { width: '200px', size: size })] }), (0, jsx_runtime_1.jsxs)(ControlGroup_1.default, { fixed: true, children: [(0, jsx_runtime_1.jsx)(Skeleton_1.ReqoreSkeleton, { size: size }), (0, jsx_runtime_1.jsx)(Skeleton_1.ReqoreSkeleton, { size: size })] })] }), !isCollapsed &&
|
|
570
556
|
(children ? (children) : ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, { vertical: true, children: (0, jsx_runtime_1.jsx)(Skeleton_1.ReqoreSkeleton, { lines: 5, width: '100%', size: 'tiny' }) })))] }));
|
|
571
557
|
});
|
|
572
|
-
/** A description given no effect: one object, so what is made from it holds from render to render. */
|
|
573
|
-
var NO_DESCRIPTION_EFFECT = {};
|
|
574
558
|
exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
575
|
-
var _b, _c
|
|
576
|
-
var children = _a.children, label = _a.label, description = _a.description,
|
|
559
|
+
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"]);
|
|
577
561
|
// Resolved ONCE, here — the accent styles interpolate px and reserve padding,
|
|
578
562
|
// so they must only ever see a number. Shared with ReqoreCallout.
|
|
579
563
|
var accentSizePx = (0, react_2.useMemo)(function () { return (0, utils_1.resolveAccentSize)(accentSize); }, [accentSize]);
|
|
580
|
-
var
|
|
564
|
+
var _7 = (0, react_2.useState)(isCollapsed || false), _isCollapsed = _7[0], setIsCollapsed = _7[1];
|
|
581
565
|
var primaryContentGradient = (0, Effect_1.getPrimaryGradient)(contentEffect === null || contentEffect === void 0 ? void 0 : contentEffect.gradient);
|
|
582
566
|
var primaryContentColors = primaryContentGradient && typeof primaryContentGradient.colors === 'object'
|
|
583
567
|
? primaryContentGradient.colors
|
|
@@ -600,8 +584,8 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
600
584
|
var isHoverCapable = (0, useReqoreContext_1.useReqoreProperty)('isHoverCapable');
|
|
601
585
|
var floatingActions = !!floatingActionsProp && isHoverCapable !== false;
|
|
602
586
|
var setRef = (0, useCombinedRefs_1.useCombinedRefs)(ref).setRef;
|
|
603
|
-
var
|
|
604
|
-
var
|
|
587
|
+
var _8 = (0, react_use_1.useMeasure)(), measureRef = _8[0], width = _8[1].width;
|
|
588
|
+
var _9 = (0, react_2.useState)(false), _isHovered = _9[0], setIsHovered = _9[1];
|
|
605
589
|
var floatingActionsRef = (0, react_2.useRef)(null);
|
|
606
590
|
var panelRef = (0, react_2.useRef)(null);
|
|
607
591
|
var hoverTimerRef = (0, react_2.useRef)(null);
|
|
@@ -619,8 +603,8 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
619
603
|
// triggers it. Only wired when `stickyHeader` is on, so ordinary panels pay
|
|
620
604
|
// nothing.
|
|
621
605
|
var stickySentinelRef = (0, react_2.useRef)(null);
|
|
622
|
-
var
|
|
623
|
-
var
|
|
606
|
+
var _10 = (0, react_2.useState)(false), isHeaderStuck = _10[0], setIsHeaderStuck = _10[1];
|
|
607
|
+
var _11 = (0, react_2.useState)(0), stickyInset = _11[0], setStickyInset = _11[1];
|
|
624
608
|
(0, react_2.useEffect)(function () {
|
|
625
609
|
var _a;
|
|
626
610
|
if (!rest.stickyHeader) {
|
|
@@ -1061,36 +1045,6 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1061
1045
|
}, [intent, theme, contentEffect, interactive]);
|
|
1062
1046
|
var opacity = rest.transparent ? 0 : rest.opacity;
|
|
1063
1047
|
var noHorizontalPadding = opacity === 0 && flat && !intent && !rest.raised;
|
|
1064
|
-
/* What the panel holds is drawn on the panel - its content on the panel's background, its
|
|
1065
|
-
title bar and bottom actions on the bar's - and is told so, to pick its text and icons
|
|
1066
|
-
against that rather than the page. */
|
|
1067
|
-
var aroundSurface = (0, SurfaceContext_1.useReqoreSurface)();
|
|
1068
|
-
// a panel drawn at no opacity is on what is around it: what a component there says, or its customTheme's main
|
|
1069
|
-
var surface = (0, react_2.useMemo)(function () { return (0, surface_1.getUnpaintedSurface)(theme, customTheme, aroundSurface, opacity === 0); }, [theme, customTheme, aroundSurface, opacity]);
|
|
1070
|
-
var contentSurface = (0, react_2.useMemo)(function () {
|
|
1071
|
-
return (0, colors_2.getDrawnColor)(getPanelFill(theme, opacity !== null && opacity !== void 0 ? opacity : 1), (0, colors_2.getThemeSurface)(theme, surface));
|
|
1072
|
-
}, [theme, opacity, surface]);
|
|
1073
|
-
/* each color of the content's gradient, when its effect draws one: for as long as its colors hold, not the
|
|
1074
|
-
effect object - one given inline is new on every render, and so was every surface the panel hands down */
|
|
1075
|
-
var contentGradientKey = JSON.stringify((_b = transformedContentEffect === null || transformedContentEffect === void 0 ? void 0 : transformedContentEffect.gradient) !== null && _b !== void 0 ? _b : null);
|
|
1076
|
-
var contentSurfaces = (0, react_2.useMemo)(function () {
|
|
1077
|
-
return (0, Effect_1.getEffectBackgrounds)(theme, transformedContentEffect, contentSurface, (0, colors_2.getThemeSurface)(theme, surface));
|
|
1078
|
-
}, [theme, contentGradientKey, contentSurface, surface]);
|
|
1079
|
-
var barSurface = (0, react_2.useMemo)(function () {
|
|
1080
|
-
return contentSurfaces.map(function (under) {
|
|
1081
|
-
return (0, colors_2.getDrawnColor)(getPanelBarFill(theme, minimal ? 0 : (opacity !== null && opacity !== void 0 ? opacity : 1)), under);
|
|
1082
|
-
});
|
|
1083
|
-
}, [theme, minimal, opacity, contentSurfaces]);
|
|
1084
|
-
// The bar's description and icon fade only as far as they stay readable there.
|
|
1085
|
-
var barText = (0, react_2.useMemo)(function () { return (0, colors_2.getReadableTextOn)(theme, barSurface); }, [theme, barSurface]);
|
|
1086
|
-
/* The panel's own text (what it holds that sets no color of its own) is read on what its content is drawn on, as
|
|
1087
|
-
what it holds is - not on the theme's main, which it does not paint: it paints it a step darker, and at less
|
|
1088
|
-
than full opacity barely at all. On a mid grey the step alone decides which text reads. */
|
|
1089
|
-
var panelText = (0, react_2.useMemo)(function () { return (0, colors_2.getReadableTextOn)(theme, contentSurfaces); }, [theme, contentSurfaces]);
|
|
1090
|
-
// the title icon's own color: in its props (which win, as they are spread over the rest), else the panel's
|
|
1091
|
-
var _13 = (0, iconProps_1.splitIconColor)(iconProps), titleIconPropsColor = _13[0], titleIconRest = _13[1];
|
|
1092
|
-
var titleIconOwn = titleIconPropsColor || iconColor;
|
|
1093
|
-
var titleIconLook = (0, react_2.useMemo)(function () { return (0, colors_2.getReadableIconLook)(theme, barSurface, barText, colors_1.CONTROL_ICON_OPACITY, titleIconOwn); }, [theme, barSurface, barText, titleIconOwn]);
|
|
1094
1048
|
// The media frame's outer corners follow the panel's INNER curve: its radius, less the 1px
|
|
1095
1049
|
// border when it draws one — the same inset the sticky header and the accent strip take.
|
|
1096
1050
|
var mediaRadius = rounded
|
|
@@ -1122,7 +1076,7 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1122
1076
|
* The title's natural size in px, from the heading level it renders at — the same
|
|
1123
1077
|
* `labelSize || HEADER_SIZE_TO_NUMBER[panelSize]` the icon is sized from.
|
|
1124
1078
|
*/
|
|
1125
|
-
var labelNaturalPx = (
|
|
1079
|
+
var labelNaturalPx = (_b = sizes_1.HEADER_LEVEL_TO_PX[labelSize || sizes_1.HEADER_SIZE_TO_NUMBER[panelSize]]) !== null && _b !== void 0 ? _b : sizes_1.HEADER_LEVEL_TO_PX[3];
|
|
1126
1080
|
/**
|
|
1127
1081
|
* SECOND thing to give: the title's size. Once the actions are down to icons and the
|
|
1128
1082
|
* row is still short, the title shrinks toward a floor rather than dropping characters
|
|
@@ -1152,8 +1106,8 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1152
1106
|
* way it always has. When it IS cut, that same click must not reach the bar — opening the
|
|
1153
1107
|
* text and folding the panel away in one gesture is the worst of both.
|
|
1154
1108
|
*/
|
|
1155
|
-
var
|
|
1156
|
-
var
|
|
1109
|
+
var _12 = (0, react_2.useState)(false), isDescriptionExpanded = _12[0], setIsDescriptionExpanded = _12[1];
|
|
1110
|
+
var _13 = (0, react_2.useState)(false), isDescriptionTruncated = _13[0], setIsDescriptionTruncated = _13[1];
|
|
1157
1111
|
var descriptionRef = (0, react_2.useRef)(null);
|
|
1158
1112
|
var descriptionIsClamped = descriptionClamp > 0 && !isDescriptionExpanded;
|
|
1159
1113
|
(0, react_2.useLayoutEffect)(function () {
|
|
@@ -1170,23 +1124,9 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1170
1124
|
event.stopPropagation();
|
|
1171
1125
|
setIsDescriptionExpanded(function (expanded) { return !expanded; });
|
|
1172
1126
|
}, [descriptionIsInteractive]);
|
|
1173
|
-
/* Dimmer than the title, as far as it stays readable on the bar: the color it is drawn in - its effect's
|
|
1174
|
-
(where the theme can resolve it), its intent's, else the bar's text - at 0.7, or as much more as it needs.
|
|
1175
|
-
An opacity the caller gives is the caller's, as given. Worked out only for a description there is. */
|
|
1176
|
-
var descriptionLook = (0, react_2.useMemo)(function () {
|
|
1177
|
-
if (!description || descriptionEffect.opacity !== undefined) {
|
|
1178
|
-
return descriptionEffect;
|
|
1179
|
-
}
|
|
1180
|
-
var drawn = descriptionEffect.color
|
|
1181
|
-
? (0, surface_1.getDrawnEffectTextColor)(theme, descriptionEffect.color, barSurface)
|
|
1182
|
-
: descriptionIntent
|
|
1183
|
-
? (0, colors_2.getReadableIntentColor)(theme, descriptionIntent, undefined, barSurface)
|
|
1184
|
-
: undefined;
|
|
1185
|
-
return __assign(__assign({}, descriptionEffect), { opacity: (0, colors_2.getReadableAlpha)(drawn !== null && drawn !== void 0 ? drawn : barText, barSurface, 0.7) });
|
|
1186
|
-
}, [description, descriptionEffect, descriptionIntent, theme, barSurface, barText]);
|
|
1187
1127
|
/** Shared by both places the description can render — inline with the title, or on its
|
|
1188
1128
|
* own row below — so the two cannot drift apart. */
|
|
1189
|
-
var descriptionProps = __assign({ ref: descriptionRef, className: 'reqore-panel-title-description', size: panelSize, effect:
|
|
1129
|
+
var descriptionProps = __assign({ ref: descriptionRef, className: 'reqore-panel-title-description', size: panelSize, effect: __assign({ opacity: 0.7 }, descriptionEffect), intent: descriptionIntent, onClick: handleDescriptionClick }, (descriptionIsInteractive
|
|
1190
1130
|
? {
|
|
1191
1131
|
role: 'button',
|
|
1192
1132
|
tabIndex: 0,
|
|
@@ -1200,19 +1140,19 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1200
1140
|
style: { cursor: 'pointer' },
|
|
1201
1141
|
}
|
|
1202
1142
|
: {}));
|
|
1203
|
-
var
|
|
1204
|
-
var
|
|
1143
|
+
var _14 = (0, react_2.useState)(undefined), labelAvailable = _14[0], setLabelAvailable = _14[1];
|
|
1144
|
+
var _15 = (0, useFitTextSize_1.useFitTextSize)({
|
|
1205
1145
|
text: typeof label === 'string' ? label : '',
|
|
1206
1146
|
available: labelAvailable,
|
|
1207
1147
|
max: labelNaturalPx,
|
|
1208
1148
|
min: labelMinTextSize,
|
|
1209
1149
|
lines: clampLines,
|
|
1210
1150
|
enabled: fitLabel !== false && typeof label === 'string' && !(labelEffect === null || labelEffect === void 0 ? void 0 : labelEffect.textSize),
|
|
1211
|
-
}), labelFitRef =
|
|
1151
|
+
}), labelFitRef = _15[0], labelFitPx = _15[1];
|
|
1212
1152
|
/** Only while the title is actually below its natural size, and never over a caller who
|
|
1213
1153
|
* pinned the description's own size. */
|
|
1214
1154
|
var descriptionFontPx = fitLabel && !(descriptionEffect === null || descriptionEffect === void 0 ? void 0 : descriptionEffect.textSize) && labelFitPx < labelNaturalPx
|
|
1215
|
-
? Math.max(useFitTextSize_1.FIT_TEXT_FLOOR_PX, Math.round(((
|
|
1155
|
+
? 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)))
|
|
1216
1156
|
: 0;
|
|
1217
1157
|
/**
|
|
1218
1158
|
* How much room the title has, computed rather than measured off its own box.
|
|
@@ -1295,139 +1235,138 @@ exports.ReqorePanel = (0, react_2.forwardRef)(function (_a, ref) {
|
|
|
1295
1235
|
if (skeleton) {
|
|
1296
1236
|
return (0, jsx_runtime_1.jsx)(exports.ReqorePanelSkeleton, { size: panelSize, isCollapsed: _isCollapsed });
|
|
1297
1237
|
}
|
|
1298
|
-
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ReqoreErrorBoundary, __assign({}, errorBoundaryOptions, { children: (0, jsx_runtime_1.jsxs)(TooltipComponent_1.ReqoreTooltipComponent, __assign({}, (0, lodash_1.omit)(rest, ['onResize']), _resizable, { as: rest.as || (isResizableElement ? re_resizable_1.Resizable : 'div'), isCollapsed: _isCollapsed, rounded: rounded, flat: flat, intent: intent, accentPosition: accentPosition, "$accentSize": accentSizePx, className: "".concat(className || '', " reqore-panel").concat(_isHovered && (0, lodash_1.size)(floatingActionsList) > 0 ? ' reqore-panel-floating-active' : ''), interactive: interactive, theme: theme, effect: transformedContentEffect, opacity: opacity, fluid: fluid, disabled: disabled,
|
|
1238
|
+
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ReqoreErrorBoundary, __assign({}, errorBoundaryOptions, { children: (0, jsx_runtime_1.jsxs)(TooltipComponent_1.ReqoreTooltipComponent, __assign({}, (0, lodash_1.omit)(rest, ['onResize']), _resizable, { as: rest.as || (isResizableElement ? re_resizable_1.Resizable : 'div'), isCollapsed: _isCollapsed, rounded: rounded, flat: flat, intent: intent, accentPosition: accentPosition, "$accentSize": accentSizePx, className: "".concat(className || '', " reqore-panel").concat(_isHovered && (0, lodash_1.size)(floatingActionsList) > 0 ? ' reqore-panel-floating-active' : ''), interactive: interactive, theme: theme, effect: transformedContentEffect, opacity: opacity, fluid: fluid, disabled: disabled, Component: exports.StyledPanel, ref: function (node) {
|
|
1299
1239
|
handleRef(node);
|
|
1300
1240
|
panelRef.current = node;
|
|
1301
1241
|
}, 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 &&
|
|
1302
1242
|
(0, lodash_1.size)(floatingActionsList) > 0 &&
|
|
1303
|
-
(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.
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
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 () {
|
|
1244
|
+
var hasPanelIcon = !!icon || !!iconImage || loading;
|
|
1245
|
+
// The icon takes the label's place, so there has to BE an icon. Without one
|
|
1246
|
+
// the label is the only thing identifying the panel and it stays put — a
|
|
1247
|
+
// header with neither is not a compact header, it is an empty one. The label
|
|
1248
|
+
// is not lost either way: it is already this icon's tooltip.
|
|
1249
|
+
var hideTitleText = hideTitleForIcon && hasPanelIcon;
|
|
1250
|
+
// Layout decision:
|
|
1251
|
+
// - iconWithLabel=true → render the icon INSIDE the
|
|
1252
|
+
// label-and-badge row (no outer icon column). The
|
|
1253
|
+
// description sits flush-left under the icon+label.
|
|
1254
|
+
// - When there is NO description, fall back to the
|
|
1255
|
+
// inline layout regardless of iconVerticalAlign — the
|
|
1256
|
+
// outer grid only earns its keep when there is a
|
|
1257
|
+
// description row to anchor against, and the inline
|
|
1258
|
+
// layout aligns icon-to-text glyphs more naturally
|
|
1259
|
+
// via the heading's own line-height.
|
|
1260
|
+
// - Otherwise → outer two-column grid where the icon
|
|
1261
|
+
// sits in a reserved column. iconVerticalAlign places
|
|
1262
|
+
// the icon in row 1 (label), row 2 (description), or
|
|
1263
|
+
// spans both rows (center). The description always
|
|
1264
|
+
// indents past the icon column.
|
|
1265
|
+
var inlineWithLabel = hasPanelIcon && (iconWithLabel || !description || hideTitleText);
|
|
1266
|
+
var useOuterGrid = hasPanelIcon && !inlineWithLabel;
|
|
1267
|
+
// Outer grid → grid column-gap handles icon→label
|
|
1268
|
+
// spacing, so the icon itself takes no margin.
|
|
1269
|
+
// Inline → keep 'margin=right' so ReqoreIcon adds its
|
|
1270
|
+
// standard side-spacer between icon and label.
|
|
1271
|
+
var iconMargin = useOuterGrid ? undefined : 'right';
|
|
1272
|
+
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
|
+
opacity: colors_1.CONTROL_ICON_OPACITY,
|
|
1274
|
+
} }, iconProps, { 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;
|
|
1275
|
+
var labelRow = ((0, jsx_runtime_1.jsxs)(exports.StyledPanelTitleHeaderLabelAndBadge, { className: 'reqore-panel-title-label-row', children: [inlineWithLabel && panelIcon, hideTitleText ? null : typeof label === 'string' ? (
|
|
1276
|
+
// The measured box is this wrapper, not the heading: as a
|
|
1277
|
+
// `min-width: 0` flex child it reports the width the row actually
|
|
1278
|
+
// left for the title, where the heading would report what the text
|
|
1279
|
+
// wants. `overflow: hidden` is what makes it shrinkable at all.
|
|
1280
|
+
// `display: flex` keeps the wrapper from opening a line box around
|
|
1281
|
+
// the inline-flex heading: a block wrapper adds the row's leading on
|
|
1282
|
+
// top of the heading's own box, which made a `tiny` panel 3px taller
|
|
1283
|
+
// than it was before this wrapper existed.
|
|
1284
|
+
(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({
|
|
1285
|
+
// `noWrap` pins the heading to one line; a clamped title is
|
|
1286
|
+
// allowed to wrap, and the clamp brings its own ellipsis.
|
|
1287
|
+
noWrap: clampLines === 1 }, labelEffect), style: __assign(__assign(__assign({}, (clampLines > 1
|
|
1288
|
+
? {}
|
|
1289
|
+
: { display: 'inline-flex', alignItems: 'center' })), { minWidth: 0,
|
|
1290
|
+
// Capped to the measured wrapper so the heading's own
|
|
1291
|
+
// `text-overflow: ellipsis` (from `noWrap`) has a box to overflow.
|
|
1292
|
+
// An `inline-flex` heading otherwise sizes to its text, and the
|
|
1293
|
+
// wrapper clips it mid-word with no ellipsis at all.
|
|
1294
|
+
maxWidth: '100%' }), (fitLabel !== false && !(labelEffect === null || labelEffect === void 0 ? void 0 : labelEffect.textSize)
|
|
1295
|
+
? { fontSize: "".concat(labelFitPx, "px") }
|
|
1296
|
+
: {})), 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] }));
|
|
1297
|
+
// Description size is driven by the panel size only —
|
|
1298
|
+
// explicitly NOT by `labelSize`. `NUMBER_TO_SIZE` maps
|
|
1299
|
+
// 1..6 → micro..huge, which means bumping `labelSize`
|
|
1300
|
+
// from 4 to 2 to grow the heading would inversely
|
|
1301
|
+
// shrink the description to `tiny`. That's the wrong
|
|
1302
|
+
// pairing: a bigger label should not make supporting
|
|
1303
|
+
// text smaller. Consumers that want to size the
|
|
1304
|
+
// description explicitly pass `descriptionEffect.textSize`.
|
|
1305
|
+
var descriptionRow = description && !hideTitleText && !descriptionBelow ? ((0, jsx_runtime_1.jsx)(Span_1.ReqoreSpan, __assign({}, descriptionProps, { children: description }))) : null;
|
|
1306
|
+
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] })) })));
|
|
1307
|
+
})()) : 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
|
|
1308
|
+
// The narrow bar keeps its controls in the trailing group, so this row —
|
|
1309
|
+
// which existed only for the stacked layout — never shows.
|
|
1310
|
+
, {
|
|
1369
1311
|
// The narrow bar keeps its controls in the trailing group, so this row —
|
|
1370
1312
|
// which existed only for the stacked layout — never shows.
|
|
1371
|
-
, {
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
//
|
|
1390
|
-
//
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
// flex row, so a full-width item cannot share one with anything before it.
|
|
1429
|
-
// `min-width: 0` so a long sentence wraps inside the bar instead of widening it.
|
|
1430
|
-
(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: (0, jsx_runtime_1.jsx)(SurfaceContext_1.ReqoreSurfaceProvider, { color: contentSurfaces, children: children }) })) : null, hasBottomActions && !_isCollapsed ? ((0, jsx_runtime_1.jsx)(SurfaceContext_1.ReqoreSurfaceProvider, { color: barSurface, children: (0, jsx_runtime_1.jsxs)(exports.StyledPanelBottomActions, { flat: flat, className: 'reqore-panel-bottom-actions', theme: theme, padded: padded, intent: intent, minimal: minimal || opacity === 0, opacity: minimal ? 0 : (opacity !== null && opacity !== void 0 ? opacity : 1), size: contentSize || panelSize, noHorizontalPadding: noHorizontalPadding, children: [hasNonResponsiveActions(leftBottomActions) ? ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, { size: panelSize, style: { marginRight: 'auto' }, children: leftBottomActions.map(renderNonResponsiveActions('flex-start')) })) : null, hasResponsiveActions(leftBottomActions) && ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, { fluid: responsiveActions, responsive: responsiveActions, customTheme: theme, size: panelSize, style: { marginRight: 'auto' }, children: leftBottomActions.map(renderResponsiveActions('flex-start')) })), hasResponsiveActions(rightBottomActions) && ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, { fluid: responsiveActions, horizontalAlign: 'flex-end', responsive: responsiveActions, customTheme: theme, style: { marginLeft: 'auto' }, size: panelSize, children: rightBottomActions.map(renderResponsiveActions()) })), hasNonResponsiveActions(rightBottomActions) ? ((0, jsx_runtime_1.jsx)(ControlGroup_1.default, { horizontalAlign: 'flex-end', size: panelSize, style: { marginLeft: 'auto' }, children: rightBottomActions.map(renderNonResponsiveActions()) })) : null] }) })) : null, !_isCollapsed && mediaPosition === 'bottom' ? mediaNode : null] })) })));
|
|
1313
|
+
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,
|
|
1314
|
+
// Not fluid by default. `fluid` emits `width: 100%`, so the group's flex basis
|
|
1315
|
+
// becomes the whole bar and the title — the only shrinkable thing on the other
|
|
1316
|
+
// side — collapses to nothing: measured at 0px of title on a 400px panel, and
|
|
1317
|
+
// 142px of a 518px bar where the buttons needed 90.
|
|
1318
|
+
//
|
|
1319
|
+
// A caller whose actions include something with no useful width of its own —
|
|
1320
|
+
// Collection puts a search input in here — opts back in through
|
|
1321
|
+
// `responsiveActionsWrapperProps`, because `fluid` is also what ControlGroup
|
|
1322
|
+
// propagates to its children, and that input has nothing to fill without it.
|
|
1323
|
+
fluid: false, horizontalAlign: 'flex-end', customTheme: theme, size: panelSize }, responsiveActionsWrapperProps, {
|
|
1324
|
+
// The cap is the whole fix. Half the bar guarantees the title the other half,
|
|
1325
|
+
// and the moment the buttons need more than their share the group overflows —
|
|
1326
|
+
// which is what `responsive` collapse watches (`scrollWidth > clientWidth`), so
|
|
1327
|
+
// the fold into the `…` menu still fires. Floored at 40px because shrinking to
|
|
1328
|
+
// nothing clips the buttons rather than folding them, and ControlGroup ignores
|
|
1329
|
+
// its own overflow below that width, which would strand them clipped.
|
|
1330
|
+
style: __assign({
|
|
1331
|
+
// Pushed to the trailing edge. A `fluid` group used to span the bar and its
|
|
1332
|
+
// own `horizontalAlign` put the buttons on the right; a content-sized one is
|
|
1333
|
+
// only as wide as its buttons, so with no title header beside it — Tree has
|
|
1334
|
+
// no label — it would sit at the LEFT of an otherwise empty bar. `auto`
|
|
1335
|
+
// margin restores the edge without giving the group any width back.
|
|
1336
|
+
marginLeft: 'auto',
|
|
1337
|
+
// Content basis that may still shrink. `fluid={false}` alone compiles to
|
|
1338
|
+
// `flex: 0 0 auto`, which pins the group at its content width so it can never
|
|
1339
|
+
// overflow — and `responsive` collapse watches `scrollWidth > clientWidth`,
|
|
1340
|
+
// so the fold into the `…` menu would simply stop happening.
|
|
1341
|
+
flex: '0 1 auto',
|
|
1342
|
+
// Floored, because shrinking to nothing clips the buttons instead of folding
|
|
1343
|
+
// them, and ControlGroup ignores its own overflow below 40px.
|
|
1344
|
+
minWidth: 40,
|
|
1345
|
+
// Capped, so a group that IS opted back into growing cannot take the row —
|
|
1346
|
+
// but only while there is a title header to take it FROM. With no label,
|
|
1347
|
+
// badge, icon or breadcrumbs the bar is the group's alone, and holding a
|
|
1348
|
+
// Collection's search input to half of an empty bar guards nothing.
|
|
1349
|
+
maxWidth: hasTitleHeader ? '50%' : undefined }, responsiveActionsWrapperProps === null || responsiveActionsWrapperProps === void 0 ? void 0 : responsiveActionsWrapperProps.style), children: nonFloatingActions.map(renderResponsiveActions()) }))), (0, jsx_runtime_1.jsx)(NonResponsiveActions_1.ReqorePanelNonResponsiveActions, { show: showNonResponsiveGroup(), isSmall: false, showControlButtons: true, size: panelSize, hasResponsiveActions: hasResponsiveActions(nonFloatingActions), customTheme: theme, isCollapsed: _isCollapsed, onCollapseClick: collapsible ? handleCollapseClick : undefined, onCloseClick: onClose, closeButtonProps: closeButtonProps, collapseButtonProps: collapseButtonProps, collapseTooltip: collapseTooltip, expandTooltip: expandTooltip, closeTooltip: closeTooltip, fluid: !hasTitleHeader, className: NON_RESPONSIVE_ACTIONS_CLASS,
|
|
1350
|
+
// Beside a title in a NARROW bar the title comes first (qorus#646). The group is
|
|
1351
|
+
// `0 0 auto`, so a narrow bar - a table in a card on a phone - squeezed the title
|
|
1352
|
+
// to nothing and still pushed its last button past the panel's edge. Narrow, the
|
|
1353
|
+
// title takes its whole width first and the group what is left, at least what its
|
|
1354
|
+
// controls cannot do without (a search field narrows, a button never does) and at
|
|
1355
|
+
// most its own width. A basis of 0 is what gives the title the first claim: the
|
|
1356
|
+
// group is sized from the leftover, so the title shrinks only once the controls
|
|
1357
|
+
// are at their smallest - and its words break only when one is wider than the
|
|
1358
|
+
// space left beside them. Shrinking the two against each other instead, by any
|
|
1359
|
+
// factor, took a fraction of a pixel off the title, and that broke "Services" into
|
|
1360
|
+
// "Servic / es". Room the title does not need goes to the group first (a grow no
|
|
1361
|
+
// title's comes near), so a search field widens before the title's box does. A
|
|
1362
|
+
// wide bar keeps the group at its own width: there the title's claim was its
|
|
1363
|
+
// one-line width, a description beside it included, and a long description
|
|
1364
|
+
// squeezed a table's search to its least instead of wrapping.
|
|
1365
|
+
style: hasTitleHeader && isNarrow ? NARROW_ACTIONS_BESIDE_TITLE : undefined, children: nonFloatingActions.map(renderNonResponsiveActions()) }), descriptionBelow ? (
|
|
1366
|
+
// `flex-basis: 100%` is what puts it on its own line — the bar is a wrapping
|
|
1367
|
+
// flex row, so a full-width item cannot share one with anything before it.
|
|
1368
|
+
// `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] })) })));
|
|
1431
1370
|
});
|
|
1432
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;
|
|
1433
1372
|
//# sourceMappingURL=index.js.map
|