@sprinklrjs/spaceweb 14.12.3 → 14.13.0

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.
@@ -1 +1,11 @@
1
- export { default } from 'classnames';
1
+ import baseClassnames from 'classnames';
2
+ /**
3
+ * classNames is a merging utility for class names.
4
+ * When importing, please import as `cx` or `classNames`.
5
+ * @warning This is NOT the same as the `css` themes utility.
6
+ * `css` is provided by the useStyle() hook and can handle CSS-in-JS, functions, and CSSProperties.
7
+ * `cx` **cannot** handle these, and will not work with functions or StyleObjects!
8
+ * @see https://github.com/JedWatson/classnames?tab=readme-ov-file#usage
9
+ */
10
+ declare const documentedClassnames: typeof baseClassnames;
11
+ export default documentedClassnames;
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.default = void 0;
7
- var classnames_1 = require("classnames");
8
- Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(classnames_1).default; } });
3
+ var tslib_1 = require("tslib");
4
+ var classnames_1 = tslib_1.__importDefault(require("classnames"));
5
+ /**
6
+ * classNames is a merging utility for class names.
7
+ * When importing, please import as `cx` or `classNames`.
8
+ * @warning This is NOT the same as the `css` themes utility.
9
+ * `css` is provided by the useStyle() hook and can handle CSS-in-JS, functions, and CSSProperties.
10
+ * `cx` **cannot** handle these, and will not work with functions or StyleObjects!
11
+ * @see https://github.com/JedWatson/classnames?tab=readme-ov-file#usage
12
+ */
13
+ var documentedClassnames = classnames_1.default;
14
+ exports.default = documentedClassnames;
@@ -1 +1,11 @@
1
- export { default } from 'classnames';
1
+ import baseClassnames from 'classnames';
2
+ /**
3
+ * classNames is a merging utility for class names.
4
+ * When importing, please import as `cx` or `classNames`.
5
+ * @warning This is NOT the same as the `css` themes utility.
6
+ * `css` is provided by the useStyle() hook and can handle CSS-in-JS, functions, and CSSProperties.
7
+ * `cx` **cannot** handle these, and will not work with functions or StyleObjects!
8
+ * @see https://github.com/JedWatson/classnames?tab=readme-ov-file#usage
9
+ */
10
+ declare const documentedClassnames: typeof baseClassnames;
11
+ export default documentedClassnames;
@@ -1 +1,11 @@
1
- export { default } from 'classnames';
1
+ import baseClassnames from 'classnames';
2
+ /**
3
+ * classNames is a merging utility for class names.
4
+ * When importing, please import as `cx` or `classNames`.
5
+ * @warning This is NOT the same as the `css` themes utility.
6
+ * `css` is provided by the useStyle() hook and can handle CSS-in-JS, functions, and CSSProperties.
7
+ * `cx` **cannot** handle these, and will not work with functions or StyleObjects!
8
+ * @see https://github.com/JedWatson/classnames?tab=readme-ov-file#usage
9
+ */
10
+ var documentedClassnames = baseClassnames;
11
+ export default documentedClassnames;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { type ReactElement } from 'react';
2
2
  import type { ClassName, ClassNameStyleFn, Styles } from '../types';
3
3
  import type { SharedProps } from './types';
4
4
  export declare const SelectArrow: ({ $isOpen, title, overrides: _overrides, ...restProps }: {
@@ -6,7 +6,7 @@ export declare const SelectArrow: ({ $isOpen, title, overrides: _overrides, ...r
6
6
  $isOpen: any;
7
7
  title: any;
8
8
  overrides: any;
9
- }) => React.ReactElement;
9
+ }) => ReactElement;
10
10
  export declare const getSearchIconContainerStyles: ClassName;
11
11
  export declare const getSearchIconStyles: ClassNameStyleFn<SharedProps>;
12
12
  export declare const getControlContainerStyles: ClassName;
@@ -18,9 +18,7 @@ export declare const OverlaySelectPopoverOverride: ({ content, children: inputCo
18
18
  closePopover: any;
19
19
  setStickySentinelRef: any;
20
20
  }) => import("react/jsx-runtime").JSX.Element;
21
- export declare const SingleValueTombstone: ({ $selectSize }: {
22
- $selectSize: any;
23
- }) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const SingleValueTombstone: import("react").ForwardRefExoticComponent<Pick<SharedProps, "$selectSize"> & import("react").RefAttributes<HTMLElement>>;
24
22
  export declare const selectMenuOverrides: {
25
23
  readonly Menu: {
26
24
  readonly props: {
@@ -1,5 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { forwardRef } from 'react';
3
4
  import { getComponentSizeTheme, getDefaultSize } from '../helpers/themeHelpers';
4
5
  import ChevronDown from '../icon/components/chevron-down';
5
6
  import { borderRadius as borderRadiusLongHandHelper } from '../helpers/longHandHelpers';
@@ -159,17 +160,17 @@ export var OverlaySelectPopoverOverride = function (_a) {
159
160
  var content = _a.content, inputContainer = _a.children, closePopover = _a.closePopover, setStickySentinelRef = _a.setStickySentinelRef;
160
161
  return (_jsxs(_Fragment, { children: [_jsx(Box, { ref: setStickySentinelRef }), inputContainer, typeof content === 'function' ? content({ closeMenu: closePopover }) : content] }));
161
162
  };
162
- export var SingleValueTombstone = function (_a) {
163
+ export var SingleValueTombstone = forwardRef(function (_a, ref) {
163
164
  var $selectSize = _a.$selectSize;
164
165
  var theme = useStyle().theme;
165
166
  var defaultHeightClass = $selectSize === 'xxxs' ? 'h-4' : 'h-4.5';
166
167
  var inputSizeTheme = getComponentSizeTheme(theme, 'input', $selectSize, getDefaultSize(theme));
167
- return (_jsx(StyledTombstone, { "data-testid": "single-value-tombstone", className: [
168
+ return (_jsx(StyledTombstone, { ref: ref, "data-testid": "single-value-tombstone", className: [
168
169
  "w-24 rounded-8 ".concat(defaultHeightClass),
169
170
  //@ts-ignore -- theme override
170
171
  (inputSizeTheme === null || inputSizeTheme === void 0 ? void 0 : inputSizeTheme.lineHeight) ? { height: inputSizeTheme === null || inputSizeTheme === void 0 ? void 0 : inputSizeTheme.lineHeight } : {},
171
172
  ] }));
172
- };
173
+ });
173
174
  export var selectMenuOverrides = {
174
175
  Menu: {
175
176
  props: {
@@ -19,10 +19,10 @@ var resolveStyleObjects = function (flattenStyles, _a) {
19
19
  utils: utils,
20
20
  styletronCss: styletronCss,
21
21
  props: props,
22
- }), 2), classNames = _c[0], styletronClassNames_1 = _c[1];
22
+ }), 2), classNames_1 = _c[0], styletronClassNames_1 = _c[1];
23
23
  // save computation if `debugCssInJs` is not enabled
24
24
  return [
25
- "".concat(mergedClassnames, " ").concat(classNames),
25
+ "".concat(mergedClassnames, " ").concat(classNames_1),
26
26
  utils.debugCssInJs ? "".concat(cssInJsClassNames, " ").concat(styletronClassNames_1) : cssInJsClassNames,
27
27
  ];
28
28
  }
@@ -1,8 +1,8 @@
1
- import type { SharedPropsTabs } from './types';
2
- import type { ClassName, Styles } from '../types';
1
+ import type { SharedPropsTab, SharedPropsTabs } from './types';
2
+ import type { ClassName, StyleFn } from '../types';
3
3
  export declare const tabsStyles: (_: any, { $variant, $position }: SharedPropsTabs) => string;
4
4
  export declare const tabStyle: ClassName;
5
- export declare const tabUnderlineStyles: Styles;
5
+ export declare const tabUnderlineStyles: StyleFn<SharedPropsTab>;
6
6
  export declare const StyledTabsPanel: import("../style").StyledComponent;
7
7
  export declare const StyledRoot: import("../style").StyledComponent;
8
8
  export declare const StyledIconContainer: import("../style").StyledComponent;
@@ -35,6 +35,7 @@ export var tabStyle = function (_, _a) {
35
35
  $position === 'top' ? 'mx-4' : '',
36
36
  $position === 'left' ? 'mt-3 mb-3' : '',
37
37
  $position === 'right' ? 'mt-3 mb-3' : '',
38
+ // @ts-ignore -- theme overrides
38
39
  getTabStyleOverride,
39
40
  ];
40
41
  }
@@ -48,6 +49,7 @@ export var tabStyle = function (_, _a) {
48
49
  $position === 'top' ? 'mx-4' : '',
49
50
  $position === 'left' ? 'mt-3 mb-3' : '',
50
51
  $position === 'right' ? 'mt-3 mb-3' : '',
52
+ // @ts-ignore -- theme overrides
51
53
  getTabStyleOverride,
52
54
  ];
53
55
  }
@@ -61,7 +63,6 @@ export var tabStyle = function (_, _a) {
61
63
  });
62
64
  };
63
65
  // Adds an underline element for selected tab
64
- // @ts-ignore -- '::after' pseudo-element is not in type CSSProperties but is valid here
65
66
  export var tabUnderlineStyles = function (_a, _b) {
66
67
  var theme = _a.theme;
67
68
  var $variant = _b.$variant, $position = _b.$position, $selected = _b.$selected, $disabled = _b.$disabled;
@@ -79,8 +80,10 @@ export var tabUnderlineStyles = function (_a, _b) {
79
80
  },
80
81
  }); };
81
82
  if ($variant === 'default' && $position === 'top') {
83
+ // eslint-disable-next-line @sprinklrjs/hds-no-use-css-in-js -- No current alternatives
82
84
  if ($selected)
83
85
  return __assign(__assign({}, underlineStyle(theme.spr.borderQuinary)), { __useCssInJs: 1 });
86
+ // eslint-disable-next-line @sprinklrjs/hds-no-use-css-in-js -- No current alternatives
84
87
  if (!$disabled)
85
88
  return { ':hover': underlineStyle(theme.spr.borderQuaternary), __useCssInJs: 1 };
86
89
  }
package/esm/tabs/tab.js CHANGED
@@ -26,6 +26,8 @@ var Tab = function (props) {
26
26
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
27
27
  }, [onChange, onClick, tabId]);
28
28
  var _className = useMemo(function () { return [resetStyles, tabStyle, className]; }, [className]);
29
+ // eslint-disable-next-line @sprinklrjs/no-ts-ignores -- No current alternatives
30
+ // @ts-ignore -- CSS-in-JS -- Styletron styles used for the underline
29
31
  var _style = useMemo(function () { return [tabUnderlineStyles, style]; }, [style]);
30
32
  return (_jsx(TabComp, __assign({ "data-spaceweb": "tab", role: "tab", "aria-selected": _selected,
31
33
  // id should not be passed to DOM.
@@ -114,7 +114,9 @@ var RangeSelectorContainer = function (_a) {
114
114
  fill: theme.spr.clrRed,
115
115
  });
116
116
  } }), _jsx(Typography, __assign({ className: "my-0", variant: "bs3" }, { children: errMsg }))] }))) : null;
117
- return (_jsxs(Box, __assign({ className: "spr-ui-01 rounded-8" }, { children: [_jsxs(Header, __assign({ "$setTimezone": setTimezone, "$onClose": props.onClose }, headerProps, { children: [_jsx(HeaderBeforeEnhancer, __assign({ variant: "heading-7", "$as": "span", className: "flex items-center" }, headerBeforeEnhancerProps, { children: locale.timeRangePicker.headerLabel })), disableTimezone ? null : (_jsx(TimezonePicker, __assign({ setTimezone: setTimezone, timezone: timezone, timezoneOptions: timezoneOptions }, timezonePickerProps, { className: ['w-0 grow max-w-md', timezonePickerProps === null || timezonePickerProps === void 0 ? void 0 : timezonePickerProps.className] })))] })), _jsx(RangeSelector, __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: _jsx(Footer, __assign({ "$hasError": hasError, "$onSubmit": handleSubmit, "$onClose": props.onClose }, footerProps, { className: ['px-6 py-3 mt-2', footerProps.className] }, { children: _jsxs(Box, __assign({ className: "justify-between w-0 grow flex" }, { children: [_jsx(FooterBeforeEnhancer, __assign({}, footerBeforeEnhancerProps)), _jsxs(Stack, __assign({ direction: monthsShown === 1 ? 'vertical' : 'horizontal', gap: 3, className: [cx({ 'items-center': monthsShown !== 1 }), { maxWidth: 'fit-content' }] }, { children: [monthsShown === 1 ? null : errorEl, _jsxs(StackItem, __assign({ className: "flex self-end" }, { children: [(footerProps === null || footerProps === void 0 ? void 0 : footerProps.showClearButton) ? (_jsx(Button, __assign({ size: "xs", onClick: footerProps.handleClearBtnClick, variant: "secondary", "data-testid": "clear", disabled: timeRange.length === 0 }, { children: locale.timeRangePicker.clearBtnLabel }))) : (_jsx(Button, __assign({ size: "xs", onClick: props.onClose, variant: "secondary", "data-testid": "cancel" }, { children: locale.timeRangePicker.cancelBtnLabel }))), _jsx(Button, __assign({ size: "xs", className: "ml-3", onClick: handleSubmit, disabled: hasError, "data-testid": "save" }, { children: locale.timeRangePicker.saveBtnLabel }))] })), monthsShown === 1 ? errorEl : null] }))] })) })) }, rangeSelectorProps))] })));
117
+ return (_jsxs(Box, __assign({ className: "spr-ui-01 rounded-8" }, { children: [_jsxs(Header, __assign({ "$setTimezone": setTimezone, "$onClose": props.onClose }, headerProps, { children: [_jsx(HeaderBeforeEnhancer, __assign({ variant: "heading-7", "$as": "span", className: "flex items-center" }, headerBeforeEnhancerProps, { children: locale.timeRangePicker.headerLabel })), disableTimezone ? null : (_jsx(TimezonePicker, __assign({ setTimezone: setTimezone, timezone: timezone, timezoneOptions: timezoneOptions }, timezonePickerProps, { className: ['w-0 grow max-w-md', timezonePickerProps === null || timezonePickerProps === void 0 ? void 0 : timezonePickerProps.className] })))] })), _jsx(RangeSelector, __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: _jsx(Footer, __assign({ "$hasError": hasError, "$onSubmit": handleSubmit, "$onClose": props.onClose }, footerProps, { className: ['px-6 py-3 mt-2', footerProps.className] }, { children: _jsxs(Box, __assign({ className: "justify-between w-0 grow flex" }, { children: [_jsx(FooterBeforeEnhancer, __assign({}, footerBeforeEnhancerProps)), _jsxs(Stack, __assign({ direction: monthsShown === 1 ? 'vertical' : 'horizontal', gap: 3,
118
+ // @ts-ignore -- CSS-in-JS
119
+ className: [cx({ 'items-center': monthsShown !== 1 }), { maxWidth: 'fit-content' }] }, { children: [monthsShown === 1 ? null : errorEl, _jsxs(StackItem, __assign({ className: "flex self-end" }, { children: [(footerProps === null || footerProps === void 0 ? void 0 : footerProps.showClearButton) ? (_jsx(Button, __assign({ size: "xs", onClick: footerProps.handleClearBtnClick, variant: "secondary", "data-testid": "clear", disabled: timeRange.length === 0 }, { children: locale.timeRangePicker.clearBtnLabel }))) : (_jsx(Button, __assign({ size: "xs", onClick: props.onClose, variant: "secondary", "data-testid": "cancel" }, { children: locale.timeRangePicker.cancelBtnLabel }))), _jsx(Button, __assign({ size: "xs", className: "ml-3", onClick: handleSubmit, disabled: hasError, "data-testid": "save" }, { children: locale.timeRangePicker.saveBtnLabel }))] })), monthsShown === 1 ? errorEl : null] }))] })) })) }, rangeSelectorProps))] })));
118
120
  };
119
121
  RangeSelectorContainer.displayName = 'RangeSelectorContainer';
120
122
  export default RangeSelectorContainer;
package/esm/types.d.ts CHANGED
@@ -90,7 +90,7 @@ export type StyleUtils = ThemeContext & {
90
90
  getStyle: GetStyle;
91
91
  px2rem: Px2Rem;
92
92
  };
93
- export type ClassNameStyleFn<P = any> = (utils: StyleUtils, props: P) => string | undefined | RecursiveArray<string | undefined>;
93
+ export type ClassNameStyleFn<P = any> = (utils: StyleUtils, props: P) => ClassName;
94
94
  /**
95
95
  * ClassName type for Spaceweb's components
96
96
  * See: https://frontend.sprinklr.com/spaceweb/guides/styling#styled
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprinklrjs/spaceweb",
3
- "version": "14.12.3",
3
+ "version": "14.13.0",
4
4
  "description": "Components for SpaceWeb",
5
5
  "main": "index.js",
6
6
  "module": "./esm/index.js",
@@ -38,7 +38,7 @@
38
38
  "body-scroll-lock": "3.1.5",
39
39
  "card-validator": "^6.2.0",
40
40
  "class-variance-authority": "^0.7.0",
41
- "classnames": "2.2.6",
41
+ "classnames": "^2.5.1",
42
42
  "csstype": "^3.0.2",
43
43
  "date-fns": "^2.6.0",
44
44
  "date-fns-tz": "^1.2.2",
@@ -100,7 +100,7 @@
100
100
  "ts-node": "^10.4.0"
101
101
  },
102
102
  "peerDependencies": {
103
- "@sprinklrjs/spaceweb-themes": "14.12.3",
103
+ "@sprinklrjs/spaceweb-themes": "14.13.0",
104
104
  "react": ">=17.0.2 <19.0.0",
105
105
  "react-dom": ">=17.0.2 <19.0.0"
106
106
  }
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import { type ReactElement } from 'react';
2
2
  import type { ClassName, ClassNameStyleFn, Styles } from '../types';
3
3
  import type { SharedProps } from './types';
4
4
  export declare const SelectArrow: ({ $isOpen, title, overrides: _overrides, ...restProps }: {
@@ -6,7 +6,7 @@ export declare const SelectArrow: ({ $isOpen, title, overrides: _overrides, ...r
6
6
  $isOpen: any;
7
7
  title: any;
8
8
  overrides: any;
9
- }) => React.ReactElement;
9
+ }) => ReactElement;
10
10
  export declare const getSearchIconContainerStyles: ClassName;
11
11
  export declare const getSearchIconStyles: ClassNameStyleFn<SharedProps>;
12
12
  export declare const getControlContainerStyles: ClassName;
@@ -18,9 +18,7 @@ export declare const OverlaySelectPopoverOverride: ({ content, children: inputCo
18
18
  closePopover: any;
19
19
  setStickySentinelRef: any;
20
20
  }) => import("react/jsx-runtime").JSX.Element;
21
- export declare const SingleValueTombstone: ({ $selectSize }: {
22
- $selectSize: any;
23
- }) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const SingleValueTombstone: import("react").ForwardRefExoticComponent<Pick<SharedProps, "$selectSize"> & import("react").RefAttributes<HTMLElement>>;
24
22
  export declare const selectMenuOverrides: {
25
23
  readonly Menu: {
26
24
  readonly props: {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.selectMenuOverrides = exports.SingleValueTombstone = exports.OverlaySelectPopoverOverride = exports.getValueTypography = exports.getValueContainerStyles = exports.getControlContainerStyles = exports.getSearchIconStyles = exports.getSearchIconContainerStyles = exports.SelectArrow = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var jsx_runtime_1 = require("react/jsx-runtime");
6
+ var react_1 = require("react");
6
7
  var themeHelpers_1 = require("../helpers/themeHelpers");
7
8
  var chevron_down_1 = tslib_1.__importDefault(require("../icon/components/chevron-down"));
8
9
  var longHandHelpers_1 = require("../helpers/longHandHelpers");
@@ -165,18 +166,17 @@ var OverlaySelectPopoverOverride = function (_a) {
165
166
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(box_1.Box, { ref: setStickySentinelRef }), inputContainer, typeof content === 'function' ? content({ closeMenu: closePopover }) : content] }));
166
167
  };
167
168
  exports.OverlaySelectPopoverOverride = OverlaySelectPopoverOverride;
168
- var SingleValueTombstone = function (_a) {
169
+ exports.SingleValueTombstone = (0, react_1.forwardRef)(function (_a, ref) {
169
170
  var $selectSize = _a.$selectSize;
170
171
  var theme = (0, style_1.useStyle)().theme;
171
172
  var defaultHeightClass = $selectSize === 'xxxs' ? 'h-4' : 'h-4.5';
172
173
  var inputSizeTheme = (0, themeHelpers_1.getComponentSizeTheme)(theme, 'input', $selectSize, (0, themeHelpers_1.getDefaultSize)(theme));
173
- return ((0, jsx_runtime_1.jsx)(StyledTombstone_1.StyledTombstone, { "data-testid": "single-value-tombstone", className: [
174
+ return ((0, jsx_runtime_1.jsx)(StyledTombstone_1.StyledTombstone, { ref: ref, "data-testid": "single-value-tombstone", className: [
174
175
  "w-24 rounded-8 ".concat(defaultHeightClass),
175
176
  //@ts-ignore -- theme override
176
177
  (inputSizeTheme === null || inputSizeTheme === void 0 ? void 0 : inputSizeTheme.lineHeight) ? { height: inputSizeTheme === null || inputSizeTheme === void 0 ? void 0 : inputSizeTheme.lineHeight } : {},
177
178
  ] }));
178
- };
179
- exports.SingleValueTombstone = SingleValueTombstone;
179
+ });
180
180
  exports.selectMenuOverrides = {
181
181
  Menu: {
182
182
  props: {
@@ -22,10 +22,10 @@ var resolveStyleObjects = function (flattenStyles, _a) {
22
22
  utils: utils,
23
23
  styletronCss: styletronCss,
24
24
  props: props,
25
- }), 2), classNames = _c[0], styletronClassNames_1 = _c[1];
25
+ }), 2), classNames_1 = _c[0], styletronClassNames_1 = _c[1];
26
26
  // save computation if `debugCssInJs` is not enabled
27
27
  return [
28
- "".concat(mergedClassnames, " ").concat(classNames),
28
+ "".concat(mergedClassnames, " ").concat(classNames_1),
29
29
  utils.debugCssInJs ? "".concat(cssInJsClassNames, " ").concat(styletronClassNames_1) : cssInJsClassNames,
30
30
  ];
31
31
  }
@@ -1,8 +1,8 @@
1
- import type { SharedPropsTabs } from './types';
2
- import type { ClassName, Styles } from '../types';
1
+ import type { SharedPropsTab, SharedPropsTabs } from './types';
2
+ import type { ClassName, StyleFn } from '../types';
3
3
  export declare const tabsStyles: (_: any, { $variant, $position }: SharedPropsTabs) => string;
4
4
  export declare const tabStyle: ClassName;
5
- export declare const tabUnderlineStyles: Styles;
5
+ export declare const tabUnderlineStyles: StyleFn<SharedPropsTab>;
6
6
  export declare const StyledTabsPanel: import("../style").StyledComponent;
7
7
  export declare const StyledRoot: import("../style").StyledComponent;
8
8
  export declare const StyledIconContainer: import("../style").StyledComponent;
@@ -39,6 +39,7 @@ var tabStyle = function (_, _a) {
39
39
  $position === 'top' ? 'mx-4' : '',
40
40
  $position === 'left' ? 'mt-3 mb-3' : '',
41
41
  $position === 'right' ? 'mt-3 mb-3' : '',
42
+ // @ts-ignore -- theme overrides
42
43
  getTabStyleOverride,
43
44
  ];
44
45
  }
@@ -52,6 +53,7 @@ var tabStyle = function (_, _a) {
52
53
  $position === 'top' ? 'mx-4' : '',
53
54
  $position === 'left' ? 'mt-3 mb-3' : '',
54
55
  $position === 'right' ? 'mt-3 mb-3' : '',
56
+ // @ts-ignore -- theme overrides
55
57
  getTabStyleOverride,
56
58
  ];
57
59
  }
@@ -66,7 +68,6 @@ var tabStyle = function (_, _a) {
66
68
  };
67
69
  exports.tabStyle = tabStyle;
68
70
  // Adds an underline element for selected tab
69
- // @ts-ignore -- '::after' pseudo-element is not in type CSSProperties but is valid here
70
71
  var tabUnderlineStyles = function (_a, _b) {
71
72
  var theme = _a.theme;
72
73
  var $variant = _b.$variant, $position = _b.$position, $selected = _b.$selected, $disabled = _b.$disabled;
@@ -84,8 +85,10 @@ var tabUnderlineStyles = function (_a, _b) {
84
85
  },
85
86
  }); };
86
87
  if ($variant === 'default' && $position === 'top') {
88
+ // eslint-disable-next-line @sprinklrjs/hds-no-use-css-in-js -- No current alternatives
87
89
  if ($selected)
88
90
  return tslib_1.__assign(tslib_1.__assign({}, underlineStyle(theme.spr.borderQuinary)), { __useCssInJs: 1 });
91
+ // eslint-disable-next-line @sprinklrjs/hds-no-use-css-in-js -- No current alternatives
89
92
  if (!$disabled)
90
93
  return { ':hover': underlineStyle(theme.spr.borderQuaternary), __useCssInJs: 1 };
91
94
  }
package/tabs/tab.js CHANGED
@@ -28,6 +28,8 @@ var Tab = function (props) {
28
28
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
29
29
  }, [onChange, onClick, tabId]);
30
30
  var _className = (0, react_1.useMemo)(function () { return [helpers_2.resetStyles, styled_components_1.tabStyle, className]; }, [className]);
31
+ // eslint-disable-next-line @sprinklrjs/no-ts-ignores -- No current alternatives
32
+ // @ts-ignore -- CSS-in-JS -- Styletron styles used for the underline
31
33
  var _style = (0, react_1.useMemo)(function () { return [styled_components_1.tabUnderlineStyles, style]; }, [style]);
32
34
  return ((0, jsx_runtime_1.jsx)(TabComp, tslib_1.__assign({ "data-spaceweb": "tab", role: "tab", "aria-selected": _selected,
33
35
  // id should not be passed to DOM.
@@ -116,7 +116,9 @@ var RangeSelectorContainer = function (_a) {
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, 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,
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))] })));
120
122
  };
121
123
  RangeSelectorContainer.displayName = 'RangeSelectorContainer';
122
124
  exports.default = RangeSelectorContainer;