@sprinklrjs/spaceweb 14.14.0 → 14.14.2
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/banner/banner.js +4 -4
- package/color-picker/CustomColorSelector.js +25 -15
- package/color-picker/constants.d.ts +3 -0
- package/color-picker/constants.js +3 -1
- package/date-picker/StatelessDatePicker.js +10 -8
- package/esm/banner/banner.js +3 -3
- package/esm/color-picker/CustomColorSelector.js +26 -16
- package/esm/color-picker/constants.d.ts +3 -0
- package/esm/color-picker/constants.js +2 -0
- package/esm/date-picker/StatelessDatePicker.js +10 -8
- package/esm/form-control/form-control.js +3 -3
- package/esm/helpers/colors.d.ts +1 -0
- package/esm/helpers/colors.js +14 -2
- package/esm/icon/components/{alert-solid.d.ts → error-solid.d.ts} +1 -1
- package/esm/icon/components/error-solid.js +8 -0
- package/{icon/components/alert-solid.d.ts → esm/icon/components/warning-clr.d.ts} +1 -1
- package/esm/icon/components/warning-clr.js +8 -0
- package/esm/modal/modal.d.ts +3 -3
- package/esm/modal/modal.js +3 -3
- package/esm/progressSteps/step.js +2 -2
- package/esm/snackbar/constants.js +3 -3
- package/esm/time-range-picker/RangeSelectorContainer.js +2 -4
- package/form-control/form-control.js +4 -4
- package/helpers/colors.d.ts +1 -0
- package/helpers/colors.js +16 -3
- package/{esm/icon/components/alert.d.ts → icon/components/error-solid.d.ts} +1 -1
- package/icon/components/{alert-solid.js → error-solid.js} +3 -3
- package/{esm/icon/components/error.d.ts → icon/components/warning-clr.d.ts} +1 -1
- package/icon/components/warning-clr.js +11 -0
- package/modal/modal.d.ts +3 -3
- package/modal/modal.js +4 -4
- package/package.json +2 -2
- package/progressSteps/step.js +2 -2
- package/snackbar/constants.js +4 -4
- package/time-range-picker/RangeSelectorContainer.js +3 -5
- package/tsconfig.build.tsbuildinfo +1 -1
- package/esm/icon/components/alert-solid.js +0 -8
- package/esm/icon/components/alert.js +0 -8
- package/esm/icon/components/error-clr.d.ts +0 -3
- package/esm/icon/components/error-clr.js +0 -8
- package/esm/icon/components/error.js +0 -8
- package/esm/icon/components/warning-solid.d.ts +0 -3
- package/esm/icon/components/warning-solid.js +0 -8
- package/icon/components/alert.d.ts +0 -3
- package/icon/components/alert.js +0 -11
- package/icon/components/error-clr.d.ts +0 -3
- package/icon/components/error-clr.js +0 -11
- package/icon/components/error.d.ts +0 -3
- package/icon/components/error.js +0 -11
- package/icon/components/warning-solid.d.ts +0 -3
- package/icon/components/warning-solid.js +0 -11
|
@@ -10,8 +10,8 @@ var helpers_1 = require("../helpers");
|
|
|
10
10
|
var stack_1 = require("../stack");
|
|
11
11
|
var box_1 = require("../box");
|
|
12
12
|
var info_icon_1 = tslib_1.__importDefault(require("./info-icon"));
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var warning_clr_1 = tslib_1.__importDefault(require("../icon/components/warning-clr"));
|
|
14
|
+
var error_solid_1 = tslib_1.__importDefault(require("../icon/components/error-solid"));
|
|
15
15
|
var tickCircle_solid_1 = tslib_1.__importDefault(require("../icon/components/tickCircle-solid"));
|
|
16
16
|
var overrides_1 = require("../overrides");
|
|
17
17
|
var tooltip_1 = require("../tooltip");
|
|
@@ -22,8 +22,8 @@ var classNames_1 = tslib_1.__importDefault(require("../classNames"));
|
|
|
22
22
|
var generalUtils_1 = require("../utils/generalUtils");
|
|
23
23
|
var addConditionalIds = classNames_1.default;
|
|
24
24
|
var intentToIconMap = {
|
|
25
|
-
error:
|
|
26
|
-
warning:
|
|
25
|
+
error: error_solid_1.default,
|
|
26
|
+
warning: warning_clr_1.default,
|
|
27
27
|
success: tickCircle_solid_1.default,
|
|
28
28
|
};
|
|
29
29
|
var renderWithIcon = function (intent, message) {
|
package/helpers/colors.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const isValidHex: (hex: unknown) => string | undefined;
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function hexToRgb(_hex: string): RGBColor;
|
|
9
9
|
export declare function RgbToHex({ r, g, b, a }: RGBColor): string;
|
|
10
|
+
export declare function normalizeHex(hex: string): string | undefined;
|
|
10
11
|
/**
|
|
11
12
|
* https://medium.muz.li/the-science-of-color-contrast-an-expert-designers-guide-33e84c41d156
|
|
12
13
|
* https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum#dfn-contrast-ratio
|
package/helpers/colors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeHexWithAlpha = exports.noAlphaHex = exports.HslToRgb = exports.RgbToHsl = exports.getContrastRatio = exports.getRelativeLuminance = exports.RgbToHex = exports.hexToRgb = exports.isValidHex = void 0;
|
|
3
|
+
exports.normalizeHexWithAlpha = exports.noAlphaHex = exports.HslToRgb = exports.RgbToHsl = exports.getContrastRatio = exports.getRelativeLuminance = exports.normalizeHex = exports.RgbToHex = exports.hexToRgb = exports.isValidHex = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var memoize_1 = tslib_1.__importDefault(require("lodash/memoize"));
|
|
6
6
|
var isValidHex = function (hex) {
|
|
@@ -10,7 +10,7 @@ var isValidHex = function (hex) {
|
|
|
10
10
|
if (![3, 4, 6, 8].includes(hexVal.length))
|
|
11
11
|
return undefined;
|
|
12
12
|
if (/^[0-9a-f]+$/i.test(hexVal))
|
|
13
|
-
return hexVal;
|
|
13
|
+
return hexVal.toUpperCase();
|
|
14
14
|
return undefined;
|
|
15
15
|
};
|
|
16
16
|
exports.isValidHex = isValidHex;
|
|
@@ -36,6 +36,19 @@ function RgbToHex(_a) {
|
|
|
36
36
|
.join(''));
|
|
37
37
|
}
|
|
38
38
|
exports.RgbToHex = RgbToHex;
|
|
39
|
+
function normalizeHex(hex) {
|
|
40
|
+
if (!(0, exports.isValidHex)(hex))
|
|
41
|
+
return undefined;
|
|
42
|
+
var _a = hexToRgb(hex), r = _a.r, g = _a.g, b = _a.b, a = _a.a;
|
|
43
|
+
return "#".concat([r, g, b, Math.round((a !== null && a !== void 0 ? a : 1) * 255)]
|
|
44
|
+
.map(function (n) {
|
|
45
|
+
return Math.round(Math.min(Math.max(n, 0), 255))
|
|
46
|
+
.toString(16)
|
|
47
|
+
.padStart(2, '0');
|
|
48
|
+
})
|
|
49
|
+
.join(''));
|
|
50
|
+
}
|
|
51
|
+
exports.normalizeHex = normalizeHex;
|
|
39
52
|
/**
|
|
40
53
|
* https://medium.muz.li/the-science-of-color-contrast-an-expert-designers-guide-33e84c41d156
|
|
41
54
|
* https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum#dfn-contrast-ratio
|
|
@@ -96,7 +109,7 @@ function noAlphaHex(inputHex) {
|
|
|
96
109
|
}
|
|
97
110
|
exports.noAlphaHex = noAlphaHex;
|
|
98
111
|
function normalizeHexWithAlpha(hex, alpha) {
|
|
99
|
-
if (typeof alpha !== 'number' || alpha === 1 || !hex)
|
|
112
|
+
if (typeof alpha !== 'number' || alpha === 1 || !hex || !(0, exports.isValidHex)(hex))
|
|
100
113
|
return hex;
|
|
101
114
|
return (hex +
|
|
102
115
|
Math.floor(alpha * 255)
|
|
@@ -4,8 +4,8 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
var style_1 = require("../../style");
|
|
6
6
|
var icon_1 = tslib_1.__importDefault(require("../icon"));
|
|
7
|
-
function
|
|
7
|
+
function ErrorSolid(props) {
|
|
8
8
|
var _a = (0, style_1.useStyle)(), theme = _a.theme, isRTL = _a.isRTL;
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)(icon_1.default, tslib_1.__assign({ viewBox: "0 0 14 14", "data-icon-name": "
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(icon_1.default, tslib_1.__assign({ viewBox: "0 0 14 14", "data-icon-name": "ErrorSolid" }, props, { children: (0, jsx_runtime_1.jsx)("path", { d: "M7.063.012a6.994 6.994 0 106.994 6.994A6.996 6.996 0 007.063.012zm0 7.693a.701.701 0 01-.7-.699V4.21a.701.701 0 01.7-.7.701.701 0 01.7.7v2.797a.701.701 0 01-.7.7zm0 2.798a.701.701 0 01-.7-.7.701.701 0 01.7-.699.701.701 0 01.7.7.701.701 0 01-.7.699z" }) })));
|
|
10
10
|
}
|
|
11
|
-
exports.default =
|
|
11
|
+
exports.default = ErrorSolid;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var style_1 = require("../../style");
|
|
6
|
+
var icon_1 = tslib_1.__importDefault(require("../icon"));
|
|
7
|
+
function WarningClr(props) {
|
|
8
|
+
var _a = (0, style_1.useStyle)(), theme = _a.theme, isRTL = _a.isRTL;
|
|
9
|
+
return ((0, jsx_runtime_1.jsxs)(icon_1.default, tslib_1.__assign({ viewBox: "0 0 16 16", "data-icon-name": "WarningClr" }, props, { children: [(0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", d: "M16 13.518c0 .96-.778 1.738-1.738 1.738H1.738a1.738 1.738 0 0 1-1.515-2.59L6.405 1.677l.064-.105a1.83 1.83 0 0 1 3.126.105l6.182 10.99.052.098c.112.235.171.492.171.753", clipRule: "evenodd" }), (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M8 .744c.661 0 1.271.357 1.596.934l6.181 10.988.051.1a1.738 1.738 0 0 1-1.565 2.49H1.737a1.738 1.738 0 0 1-1.514-2.59L6.405 1.678l.064-.106A1.83 1.83 0 0 1 8 .744m0 1a.83.83 0 0 0-.694.376l-.03.048-6.181 10.988a.738.738 0 0 0 .643 1.1h12.525a.738.738 0 0 0 .664-1.058l-.022-.042L8.724 2.168A.83.83 0 0 0 8 1.744" }), (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", fillRule: "evenodd", d: "M8 9.99a.75.75 0 0 1-.75-.75V5.868a.75.75 0 0 1 1.5 0V9.24a.75.75 0 0 1-.75.75m-.75 1.88a.75.75 0 1 0 1.5-.007.75.75 0 1 0-1.5.007", clipRule: "evenodd" })] })));
|
|
10
|
+
}
|
|
11
|
+
exports.default = WarningClr;
|
package/modal/modal.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { ModalProps } from './types';
|
|
3
|
-
import
|
|
3
|
+
import Error from '../icon/components/error-solid';
|
|
4
4
|
import Tick from '../icon/components/tickCircle-solid';
|
|
5
|
-
import Warning from '../icon/components/warning-
|
|
5
|
+
import Warning from '../icon/components/warning-clr';
|
|
6
6
|
export declare const INTENT_TO_ICON: {
|
|
7
7
|
success: typeof Tick;
|
|
8
|
-
error: typeof
|
|
8
|
+
error: typeof Error;
|
|
9
9
|
warning: typeof Warning;
|
|
10
10
|
};
|
|
11
11
|
declare const _default: import("react").MemoExoticComponent<{
|
package/modal/modal.js
CHANGED
|
@@ -15,15 +15,15 @@ var locale_1 = require("../locale");
|
|
|
15
15
|
var overrides_2 = require("../overrides");
|
|
16
16
|
var ModalContext_1 = require("./ModalContext");
|
|
17
17
|
var useUniqueId_1 = tslib_1.__importDefault(require("../hooks/useUniqueId"));
|
|
18
|
-
var
|
|
18
|
+
var error_solid_1 = tslib_1.__importDefault(require("../icon/components/error-solid"));
|
|
19
19
|
var tickCircle_solid_1 = tslib_1.__importDefault(require("../icon/components/tickCircle-solid"));
|
|
20
|
-
var
|
|
20
|
+
var warning_clr_1 = tslib_1.__importDefault(require("../icon/components/warning-clr"));
|
|
21
21
|
var themeHelpers_1 = require("../helpers/themeHelpers");
|
|
22
22
|
var CloseButton = function (closeProps) { return ((0, jsx_runtime_1.jsx)(button_1.IconButton, tslib_1.__assign({}, closeProps, { children: (0, jsx_runtime_1.jsx)(close_1.default, {}) }))); };
|
|
23
23
|
exports.INTENT_TO_ICON = {
|
|
24
24
|
success: tickCircle_solid_1.default,
|
|
25
|
-
error:
|
|
26
|
-
warning:
|
|
25
|
+
error: error_solid_1.default,
|
|
26
|
+
warning: warning_clr_1.default,
|
|
27
27
|
};
|
|
28
28
|
var getWarningIconClassName = function (_a) {
|
|
29
29
|
var theme = _a.theme;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprinklrjs/spaceweb",
|
|
3
|
-
"version": "14.14.
|
|
3
|
+
"version": "14.14.2",
|
|
4
4
|
"description": "Components for SpaceWeb",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"ts-node": "^10.4.0"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
|
-
"@sprinklrjs/spaceweb-themes": "14.14.
|
|
104
|
+
"@sprinklrjs/spaceweb-themes": "14.14.2",
|
|
105
105
|
"react": ">=17.0.2 <19.0.0",
|
|
106
106
|
"react-dom": ">=17.0.2 <19.0.0"
|
|
107
107
|
}
|
package/progressSteps/step.js
CHANGED
|
@@ -6,10 +6,10 @@ var react_1 = require("react");
|
|
|
6
6
|
var overrides_1 = require("../overrides");
|
|
7
7
|
var styled_components_1 = require("./styled-components");
|
|
8
8
|
var tickCircle_solid_1 = tslib_1.__importDefault(require("../icon/components/tickCircle-solid"));
|
|
9
|
-
var
|
|
9
|
+
var error_solid_1 = tslib_1.__importDefault(require("../icon/components/error-solid"));
|
|
10
10
|
var constants_1 = require("./constants");
|
|
11
11
|
var INTENT_TO_ICON_MAP = {
|
|
12
|
-
error: (0, jsx_runtime_1.jsx)(
|
|
12
|
+
error: (0, jsx_runtime_1.jsx)(error_solid_1.default, { size: 16, className: "spr-support-error-text" }),
|
|
13
13
|
};
|
|
14
14
|
var Step = function (_a) {
|
|
15
15
|
var _b = _a.overrides, overrides = _b === void 0 ? {} : _b, isCompleted = _a.isCompleted, isCurrent = _a.isCurrent, isActive = _a.isActive, _c = _a.intent, intent = _c === void 0 ? 'default' : _c, isRightBeforeActive = _a.isRightBeforeActive, _d = _a.isLast, isLast = _d === void 0 ? false : _d, childrenCount = _a.childrenCount, _e = _a.orientation, orientation = _e === void 0 ? constants_1.ORIENTATION.vertical : _e, title = _a.title, subTitle = _a.subTitle, alwaysShowDescription = _a.alwaysShowDescription, children = _a.children, className = _a.className, onClick = _a.onClick, variant = _a.variant, role = _a.role, style = _a.style, step = _a.step, showStepNumber = _a.showStepNumber, restProps = tslib_1.__rest(_a, ["overrides", "isCompleted", "isCurrent", "isActive", "intent", "isRightBeforeActive", "isLast", "childrenCount", "orientation", "title", "subTitle", "alwaysShowDescription", "children", "className", "onClick", "variant", "role", "style", "step", "showStepNumber"]);
|
package/snackbar/constants.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TYPE_TO_HIDE_DURATION = exports.INTENT_TO_ROLE = exports.INTENT_TO_ICON = exports.TRANSITION_DURATION = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var error_solid_1 = tslib_1.__importDefault(require("../icon/components/error-solid"));
|
|
6
|
+
var warning_clr_1 = tslib_1.__importDefault(require("../icon/components/warning-clr"));
|
|
7
7
|
var tickCircle_solid_1 = tslib_1.__importDefault(require("../icon/components/tickCircle-solid"));
|
|
8
8
|
var delete_solid_1 = tslib_1.__importDefault(require("../icon/components/delete-solid"));
|
|
9
9
|
exports.TRANSITION_DURATION = 1000;
|
|
10
10
|
exports.INTENT_TO_ICON = {
|
|
11
11
|
success: tickCircle_solid_1.default,
|
|
12
|
-
error:
|
|
13
|
-
warning:
|
|
12
|
+
error: error_solid_1.default,
|
|
13
|
+
warning: warning_clr_1.default,
|
|
14
14
|
delete: delete_solid_1.default,
|
|
15
15
|
};
|
|
16
16
|
exports.INTENT_TO_ROLE = {
|
|
@@ -12,7 +12,7 @@ var button_1 = require("../button");
|
|
|
12
12
|
var styled_component_1 = require("./styled-component");
|
|
13
13
|
var stack_1 = require("../stack");
|
|
14
14
|
var TimezonePicker_1 = tslib_1.__importDefault(require("./TimezonePicker"));
|
|
15
|
-
var
|
|
15
|
+
var error_solid_1 = tslib_1.__importDefault(require("../icon/components/error-solid"));
|
|
16
16
|
var styled_components_1 = require("../date-picker/styled-components");
|
|
17
17
|
var locale_1 = require("../locale");
|
|
18
18
|
var utils_1 = require("./utils");
|
|
@@ -110,15 +110,13 @@ var RangeSelectorContainer = function (_a) {
|
|
|
110
110
|
}, [timeRange, preset, timezone, onSubmit, disableTimezone]);
|
|
111
111
|
// show error message only when it is present, hasError can be true when user has not selected any date,
|
|
112
112
|
// but we are showing any error message for that scenario.
|
|
113
|
-
var errorEl = errMsg ? ((0, jsx_runtime_1.jsxs)(stack_1.Stack, tslib_1.__assign({ direction: "horizontal", gap: 1, className: (0, classNames_1.default)('mr-1', { 'items-center': monthsShown !== 1 }), shrink: true }, { children: [(0, jsx_runtime_1.jsx)(
|
|
113
|
+
var errorEl = errMsg ? ((0, jsx_runtime_1.jsxs)(stack_1.Stack, tslib_1.__assign({ direction: "horizontal", gap: 1, className: (0, classNames_1.default)('mr-1', { 'items-center': monthsShown !== 1 }), shrink: true }, { children: [(0, jsx_runtime_1.jsx)(error_solid_1.default, { size: 14, className: "block", style: function (_a) {
|
|
114
114
|
var theme = _a.theme;
|
|
115
115
|
return ({
|
|
116
116
|
fill: theme.spr.clrRed,
|
|
117
117
|
});
|
|
118
118
|
} }), (0, jsx_runtime_1.jsx)(typography_1.Typography, tslib_1.__assign({ className: "my-0", variant: "bs3" }, { children: errMsg }))] }))) : null;
|
|
119
|
-
return ((0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "spr-ui-01 rounded-8" }, { children: [(0, jsx_runtime_1.jsxs)(Header, tslib_1.__assign({ "$setTimezone": setTimezone, "$onClose": props.onClose }, headerProps, { children: [(0, jsx_runtime_1.jsx)(HeaderBeforeEnhancer, tslib_1.__assign({ variant: "heading-7", "$as": "span", className: "flex items-center" }, headerBeforeEnhancerProps, { children: locale.timeRangePicker.headerLabel })), disableTimezone ? null : ((0, jsx_runtime_1.jsx)(TimezonePicker, tslib_1.__assign({ setTimezone: setTimezone, timezone: timezone, timezoneOptions: timezoneOptions }, timezonePickerProps, { className: ['w-0 grow max-w-md', timezonePickerProps === null || timezonePickerProps === void 0 ? void 0 : timezonePickerProps.className] })))] })), (0, jsx_runtime_1.jsx)(RangeSelector, tslib_1.__assign({ overrides: props.overrides, timeSelect: props.timeSelect, timeRangePresets: timeRangePresets, timezone: timezone, timeRange: timeRange, preset: preset, onChange: onDateChange, adapter: adapter, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: minDate, maxDate: maxDate, formatString: props.formatString, locale: props.locale, fixedHeight: props.fixedHeight, monthsShown: monthsShown, hidePresetSearch: hidePresetSearch, footerContent: (0, jsx_runtime_1.jsx)(Footer, tslib_1.__assign({ "$hasError": hasError, "$onSubmit": handleSubmit, "$onClose": props.onClose }, footerProps, { className: ['px-6 py-3 mt-2', footerProps.className] }, { children: (0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "justify-between w-0 grow flex" }, { children: [(0, jsx_runtime_1.jsx)(FooterBeforeEnhancer, tslib_1.__assign({}, footerBeforeEnhancerProps)), (0, jsx_runtime_1.jsxs)(stack_1.Stack, tslib_1.__assign({ direction: monthsShown === 1 ? 'vertical' : 'horizontal', gap: 3,
|
|
120
|
-
// @ts-ignore -- CSS-in-JS
|
|
121
|
-
className: [(0, classNames_1.default)({ 'items-center': monthsShown !== 1 }), { maxWidth: 'fit-content' }] }, { children: [monthsShown === 1 ? null : errorEl, (0, jsx_runtime_1.jsxs)(stack_1.StackItem, tslib_1.__assign({ className: "flex self-end" }, { children: [(footerProps === null || footerProps === void 0 ? void 0 : footerProps.showClearButton) ? ((0, jsx_runtime_1.jsx)(button_1.Button, tslib_1.__assign({ size: "xs", onClick: footerProps.handleClearBtnClick, variant: "secondary", "data-testid": "clear", disabled: timeRange.length === 0 }, { children: locale.timeRangePicker.clearBtnLabel }))) : ((0, jsx_runtime_1.jsx)(button_1.Button, tslib_1.__assign({ size: "xs", onClick: props.onClose, variant: "secondary", "data-testid": "cancel" }, { children: locale.timeRangePicker.cancelBtnLabel }))), (0, jsx_runtime_1.jsx)(button_1.Button, tslib_1.__assign({ size: "xs", className: "ml-3", onClick: handleSubmit, disabled: hasError, "data-testid": "save" }, { children: locale.timeRangePicker.saveBtnLabel }))] })), monthsShown === 1 ? errorEl : null] }))] })) })) }, rangeSelectorProps))] })));
|
|
119
|
+
return ((0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "spr-ui-01 rounded-8" }, { children: [(0, jsx_runtime_1.jsxs)(Header, tslib_1.__assign({ "$setTimezone": setTimezone, "$onClose": props.onClose }, headerProps, { children: [(0, jsx_runtime_1.jsx)(HeaderBeforeEnhancer, tslib_1.__assign({ variant: "heading-7", "$as": "span", className: "flex items-center" }, headerBeforeEnhancerProps, { children: locale.timeRangePicker.headerLabel })), disableTimezone ? null : ((0, jsx_runtime_1.jsx)(TimezonePicker, tslib_1.__assign({ setTimezone: setTimezone, timezone: timezone, timezoneOptions: timezoneOptions }, timezonePickerProps, { className: ['w-0 grow max-w-md', timezonePickerProps === null || timezonePickerProps === void 0 ? void 0 : timezonePickerProps.className] })))] })), (0, jsx_runtime_1.jsx)(RangeSelector, tslib_1.__assign({ overrides: props.overrides, timeSelect: props.timeSelect, timeRangePresets: timeRangePresets, timezone: timezone, timeRange: timeRange, preset: preset, onChange: onDateChange, adapter: adapter, peekNextMonth: props.peekNextMonth, excludeDates: props.excludeDates, filterDate: props.filterDate, minDate: minDate, maxDate: maxDate, formatString: props.formatString, locale: props.locale, fixedHeight: props.fixedHeight, monthsShown: monthsShown, hidePresetSearch: hidePresetSearch, footerContent: (0, jsx_runtime_1.jsx)(Footer, tslib_1.__assign({ "$hasError": hasError, "$onSubmit": handleSubmit, "$onClose": props.onClose }, footerProps, { className: ['px-6 py-3 mt-2', footerProps.className] }, { children: (0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "justify-between w-0 grow flex" }, { children: [(0, jsx_runtime_1.jsx)(FooterBeforeEnhancer, tslib_1.__assign({}, footerBeforeEnhancerProps)), (0, jsx_runtime_1.jsxs)(stack_1.Stack, tslib_1.__assign({ direction: monthsShown === 1 ? 'vertical' : 'horizontal', gap: 3, className: monthsShown !== 1 ? 'items-center' : undefined, style: { maxWidth: 'fit-content' } }, { children: [monthsShown === 1 ? null : errorEl, (0, jsx_runtime_1.jsxs)(stack_1.StackItem, tslib_1.__assign({ className: "flex self-end" }, { children: [(footerProps === null || footerProps === void 0 ? void 0 : footerProps.showClearButton) ? ((0, jsx_runtime_1.jsx)(button_1.Button, tslib_1.__assign({ size: "xs", onClick: footerProps.handleClearBtnClick, variant: "secondary", "data-testid": "clear", disabled: timeRange.length === 0 }, { children: locale.timeRangePicker.clearBtnLabel }))) : ((0, jsx_runtime_1.jsx)(button_1.Button, tslib_1.__assign({ size: "xs", onClick: props.onClose, variant: "secondary", "data-testid": "cancel" }, { children: locale.timeRangePicker.cancelBtnLabel }))), (0, jsx_runtime_1.jsx)(button_1.Button, tslib_1.__assign({ size: "xs", className: "ml-3", onClick: handleSubmit, disabled: hasError, "data-testid": "save" }, { children: locale.timeRangePicker.saveBtnLabel }))] })), monthsShown === 1 ? errorEl : null] }))] })) })) }, rangeSelectorProps))] })));
|
|
122
120
|
};
|
|
123
121
|
RangeSelectorContainer.displayName = 'RangeSelectorContainer';
|
|
124
122
|
exports.default = RangeSelectorContainer;
|