@sprinklrjs/spaceweb 14.11.0 → 14.11.3

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.
Files changed (54) hide show
  1. package/baseui/datepicker/styled-components.js +2 -2
  2. package/color-picker/CustomColorSelector.d.ts +1 -1
  3. package/color-picker/CustomColorSelector.js +25 -8
  4. package/date-picker/DatePickerInput.d.ts +2 -2
  5. package/date-picker/DatePickerInput.js +1 -0
  6. package/esm/baseui/datepicker/styled-components.js +2 -2
  7. package/esm/color-picker/CustomColorSelector.d.ts +1 -1
  8. package/esm/color-picker/CustomColorSelector.js +26 -9
  9. package/esm/date-picker/DatePickerInput.d.ts +2 -2
  10. package/esm/date-picker/DatePickerInput.js +1 -0
  11. package/esm/helpers/colors.d.ts +1 -0
  12. package/esm/helpers/colors.js +14 -5
  13. package/esm/list/list.d.ts +1 -0
  14. package/esm/list/list.js +5 -4
  15. package/esm/list/types.d.ts +8 -4
  16. package/esm/list/utils.d.ts +5 -1
  17. package/esm/list/utils.js +15 -0
  18. package/esm/menu/ActionsIconButton.d.ts +5 -2
  19. package/esm/menu/StatefulSubMenu.d.ts +1 -0
  20. package/esm/menu/SubMenu.d.ts +1 -0
  21. package/esm/menu/SubMenu.js +2 -1
  22. package/esm/menu/menu-item.js +17 -7
  23. package/esm/menu/menu.d.ts +1 -0
  24. package/esm/progress/circular/CircularProgress.d.ts +3 -3
  25. package/esm/progress/circular/CircularProgress.js +3 -3
  26. package/esm/progress/linear/LinearProgress.d.ts +3 -3
  27. package/esm/progress/linear/LinearProgress.js +3 -3
  28. package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.js +21 -6
  29. package/esm/select/selectMenuAdapter/SelectMenuItem.d.ts +0 -1
  30. package/esm/time-range-picker/RangeSelectorContainer.d.ts +2 -2
  31. package/esm/time-range-picker/RangeSelectorContainer.js +13 -3
  32. package/helpers/colors.d.ts +1 -0
  33. package/helpers/colors.js +16 -6
  34. package/list/list.d.ts +1 -0
  35. package/list/list.js +3 -2
  36. package/list/types.d.ts +8 -4
  37. package/list/utils.d.ts +5 -1
  38. package/list/utils.js +17 -1
  39. package/menu/ActionsIconButton.d.ts +5 -2
  40. package/menu/StatefulSubMenu.d.ts +1 -0
  41. package/menu/SubMenu.d.ts +1 -0
  42. package/menu/SubMenu.js +2 -1
  43. package/menu/menu-item.js +16 -6
  44. package/menu/menu.d.ts +1 -0
  45. package/package.json +4 -4
  46. package/progress/circular/CircularProgress.d.ts +3 -3
  47. package/progress/circular/CircularProgress.js +2 -2
  48. package/progress/linear/LinearProgress.d.ts +3 -3
  49. package/progress/linear/LinearProgress.js +2 -2
  50. package/select/selectMenuAdapter/CollapsibleSelectMenu.js +21 -6
  51. package/select/selectMenuAdapter/SelectMenuItem.d.ts +0 -1
  52. package/time-range-picker/RangeSelectorContainer.d.ts +2 -2
  53. package/time-range-picker/RangeSelectorContainer.js +12 -2
  54. package/tsconfig.build.tsbuildinfo +1 -1
@@ -49,7 +49,7 @@ exports.StyledCalendarHeader = (0, style_1.styled)('div', 'box-border spr-text-p
49
49
  return ($density === constants_1.DENSITY.high ? 'min-h-6.5 w-full' : 'min-h-9 w-98');
50
50
  });
51
51
  exports.StyledCalendarHeader.displayName = 'StyledCalendarHeader';
52
- exports.StyledMonthHeader = (0, style_1.styled)('div', 'spr-text-01 spr-bg-primary px-1 whitespace-no-wrap border-0 border-b-1 spr-border-secondary border-b-solid spr-text-primary block text-center flex justify-center');
52
+ exports.StyledMonthHeader = (0, style_1.styled)('div', 'spr-text-01 spr-bg-primary px-1 whitespace-nowrap border-0 border-b-1 spr-border-secondary border-b-solid spr-text-primary block text-center flex justify-center');
53
53
  exports.StyledMonthHeader.displayName = 'StyledMonthHeader';
54
54
  exports.StyledMonthYearSelectButton = (0, style_1.styled)('button', 'px-2 gap-1 items-center justify-around flex cursor-pointer spr-bg-primary spr-text-01 h-8', 'border-1 spr-border-primary rounded-8 outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-[--spr-focus-01]');
55
55
  exports.StyledMonthYearSelectButton.displayName = 'StyledMonthYearSelectButton';
@@ -57,7 +57,7 @@ exports.StyledMonthYearSelectIconContainer = (0, style_1.styled)('span', 'flex i
57
57
  exports.StyledMonthYearSelectIconContainer.displayName = 'StyledMonthYearSelectIconContainer';
58
58
  exports.StyledMonth = (0, style_1.styled)('div', 'inline-block w-full');
59
59
  exports.StyledMonth.displayName = 'StyledMonth';
60
- exports.StyledWeek = (0, style_1.styled)('div', 'mb-0.5 justify-center flex w-full whitespace-no-wrap');
60
+ exports.StyledWeek = (0, style_1.styled)('div', 'mb-0.5 justify-center flex w-full whitespace-nowrap');
61
61
  exports.StyledWeek.displayName = 'StyledWeek';
62
62
  // @ts-ignore
63
63
  function generateDayStyles(defaultCode, defaultStyle) {
@@ -1,7 +1,7 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import { type RGBColor } from 'react-color';
3
3
  import type { CustomColorSelectorProps } from './types';
4
- import { ClassName, Styles } from '../types';
4
+ import type { ClassName, Styles } from '../types';
5
5
  export declare const ColorPreview: ({ color, className, style, }: {
6
6
  color?: RGBColor | undefined;
7
7
  className?: ClassName;
@@ -52,6 +52,12 @@ var CustomEditableInput = function (_a) {
52
52
  var handleChange = (0, react_1.useCallback)(function (data) {
53
53
  typedValue.current = data;
54
54
  }, []);
55
+ (0, react_1.useEffect)(function () {
56
+ // Sync typedValue to value if value changes due to another input being edited
57
+ if (label in typedValue.current && typedValue.current[label] !== value) {
58
+ typedValue.current[label] = value;
59
+ }
60
+ }, [label, value]);
55
61
  (0, react_1.useEffect)(function () {
56
62
  if (!editableInput)
57
63
  return undefined;
@@ -86,21 +92,28 @@ var ColorPickerComponent = function (_props) {
86
92
  // but @types/react-color simply passes the types through CustomPicker as-is
87
93
  // We forward CustomColorSelectorProps to the component signature but internally use InternalCustomColorSelectorProps
88
94
  var props = _props;
89
- var hex = props.hex, rgb = props.rgb, enableAlphaSelector = props.enableAlphaSelector, onChange = props.onChange, onChangeComplete = props.onChangeComplete, renderColorSuggestionPanel = props.renderColorSuggestionPanel;
95
+ var _hex = props.hex, rgb = props.rgb, enableAlphaSelector = props.enableAlphaSelector, onChange = props.onChange, onChangeComplete = props.onChangeComplete, renderColorSuggestionPanel = props.renderColorSuggestionPanel;
90
96
  // Bug in the react-color lib
91
97
  // https://github.com/casesandberg/react-color/blob/bc9a0e1dc5d11b06c511a8e02a95bd85c7129f4b/src/helpers/hue.js#L33
92
98
  // when left === containerWidth it return 360 which return 0 in hsl value the pointer shifts to the left most
93
99
  // color which cause a flickering issue
94
100
  //https://github.com/casesandberg/react-color/blob/bc9a0e1dc5d11b06c511a8e02a95bd85c7129f4b/src/components/sketch/SketchFields.js#L51
95
101
  var _a = rgb !== null && rgb !== void 0 ? rgb : {}, r = _a.r, g = _a.g, b = _a.b, a = _a.a;
102
+ // react-color doesn't support alpha hexes, so we need to insert it ourselves
103
+ var hex = (0, colors_1.normalizeHexWithAlpha)(_hex, a);
104
+ var handleHueChange = (0, react_1.useCallback)(function (data) {
105
+ // If alpha was zero and the saturation/lightness is changed, reset alpha to full
106
+ if ('a' in data && data.a === 0) {
107
+ onChange(tslib_1.__assign(tslib_1.__assign({}, data), { a: 1 }));
108
+ }
109
+ else
110
+ onChange(data);
111
+ }, [onChange]);
96
112
  var handleChange = (0, react_1.useCallback)(function (data) {
97
- var _a;
98
113
  // react-color emitted data is very dynamic and uses properties from labels
99
114
  if ('Hex' in data) {
100
- var hexValue = data.Hex;
101
- var alpha = (_a = (data.A < 100 ? data.A / 100 : a)) !== null && _a !== void 0 ? _a : 1;
102
- var newHex = alpha !== undefined && alpha !== 1 ? hexValue + Math.floor(alpha * 255).toString(16) : hexValue;
103
- var parsedRgba = (0, colors_1.hexToRgb)(newHex);
115
+ var newHex = data.Hex;
116
+ var parsedRgba = (0, colors_1.hexToRgb)(data.Hex);
104
117
  var newRgba = enableAlphaSelector ? parsedRgba : tslib_1.__assign(tslib_1.__assign({}, parsedRgba), { a: 1 }); // No alpha values when enableAlphaSelector is disabled
105
118
  onChange(newRgba);
106
119
  // No need to invoke onChange based on isValidHex as onChange is standard handler for react-color
@@ -109,17 +122,21 @@ var ColorPickerComponent = function (_props) {
109
122
  onChangeComplete({ rgb: newRgba });
110
123
  }
111
124
  else if (data.R || data.G || data.B || data.A) {
125
+ var _a = tslib_1.__read(Object.keys(data), 1), changedKey = _a[0];
126
+ // Reset alpha IF:
127
+ // Changed value is R/G/B AND current alpha is 0 AND new value is different from old value
128
+ var resetAlpha = changedKey !== 'A' && a === 0 && data[changedKey] !== { R: r, G: g, B: b }[changedKey];
112
129
  var newRgba = {
113
130
  r: getNumberWithFallback(data.R, r),
114
131
  g: getNumberWithFallback(data.G, g),
115
132
  b: getNumberWithFallback(data.B, b),
116
- a: enableAlphaSelector ? getNumberWithFallback(data.A, (a !== null && a !== void 0 ? a : 1) * 100) / 100 : 1,
133
+ a: enableAlphaSelector && !resetAlpha ? getNumberWithFallback(data.A, (a !== null && a !== void 0 ? a : 1) * 100) / 100 : 1,
117
134
  };
118
135
  onChange(newRgba);
119
136
  onChangeComplete({ rgb: newRgba });
120
137
  }
121
138
  }, [onChange, onChangeComplete, enableAlphaSelector, r, g, b, a]);
122
- return ((0, jsx_runtime_1.jsxs)(stack_1.Stack, tslib_1.__assign({ direction: "vertical", gap: 4 }, { children: [renderColorSuggestionPanel ? renderColorSuggestionPanel(hex) : null, (0, jsx_runtime_1.jsx)(box_1.Box, tslib_1.__assign({ className: "relative w-full rounded-16 overflow-hidden", style: { height: '150px' } }, { children: (0, jsx_runtime_1.jsx)(common_1.Saturation, tslib_1.__assign({}, props)) })), (0, jsx_runtime_1.jsxs)(stack_1.Stack, tslib_1.__assign({ direction: "vertical", gap: 2 }, { children: [(0, jsx_runtime_1.jsx)(box_1.Box, tslib_1.__assign({ className: "flex gap-2 justify-between ml-2" }, { children: (0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "flex flex-col items-start gap-2" }, { children: [(0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "flex items-center gap-2" }, { children: [(0, jsx_runtime_1.jsx)(box_1.Box, tslib_1.__assign({ className: "relative h-3", style: { width: enableAlphaSelector ? '261px' : '228px' } }, { children: (0, jsx_runtime_1.jsx)(common_1.Hue, tslib_1.__assign({ pointer: CustomPointer, radius: "24px" }, props)) })), (0, jsx_runtime_1.jsx)(exports.ColorPreview, { color: rgb })] })), enableAlphaSelector ? ((0, jsx_runtime_1.jsx)(box_1.Box, tslib_1.__assign({ className: "relative h-3", style: { width: '261px' } }, { children: (0, jsx_runtime_1.jsx)(common_1.Alpha, tslib_1.__assign({ pointer: CustomPointer, radius: "24px", style: { container: { margin: 0 } } }, props)) }))) : null] })) })), (0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "grid w-full gap-2",
139
+ return ((0, jsx_runtime_1.jsxs)(stack_1.Stack, tslib_1.__assign({ direction: "vertical", gap: 4 }, { children: [renderColorSuggestionPanel ? renderColorSuggestionPanel(hex) : null, (0, jsx_runtime_1.jsx)(box_1.Box, tslib_1.__assign({ className: "relative w-full h-32 rounded-16 overflow-hidden", style: { height: '150px' } }, { children: (0, jsx_runtime_1.jsx)(common_1.Saturation, tslib_1.__assign({}, props, { onChange: handleHueChange })) })), (0, jsx_runtime_1.jsxs)(stack_1.Stack, tslib_1.__assign({ direction: "vertical", gap: 2 }, { children: [(0, jsx_runtime_1.jsx)(box_1.Box, tslib_1.__assign({ className: "flex gap-2 justify-between ml-2" }, { children: (0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "flex flex-col items-start gap-2" }, { children: [(0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "flex items-center gap-2" }, { children: [(0, jsx_runtime_1.jsx)(box_1.Box, tslib_1.__assign({ className: "relative h-3", style: { width: enableAlphaSelector ? '261px' : '228px' } }, { children: (0, jsx_runtime_1.jsx)(common_1.Hue, tslib_1.__assign({ pointer: CustomPointer, radius: "24px" }, props, { onChange: handleHueChange })) })), (0, jsx_runtime_1.jsx)(exports.ColorPreview, { color: rgb })] })), enableAlphaSelector ? ((0, jsx_runtime_1.jsx)(box_1.Box, tslib_1.__assign({ className: "relative h-3", style: { width: '261px' } }, { children: (0, jsx_runtime_1.jsx)(common_1.Alpha, tslib_1.__assign({ pointer: CustomPointer, radius: "24px", style: { container: { margin: 0 } } }, props)) }))) : null] })) })), (0, jsx_runtime_1.jsxs)(box_1.Box, tslib_1.__assign({ className: "grid w-full gap-2",
123
140
  // 5 columns with alpha, 4 columns without
124
141
  style: {
125
142
  gridTemplateColumns: "".concat(enableAlphaSelector ? '73' : '99', "fr").concat(' 51fr'.repeat(enableAlphaSelector ? 4 : 3)),
@@ -1,5 +1,5 @@
1
- import { ReactElement } from 'react';
2
- import { InputProps } from '../input';
1
+ import { type ReactElement } from 'react';
2
+ import { type InputProps } from '../input';
3
3
  type DatePickerInputProps = InputProps & {
4
4
  isOpen?: boolean;
5
5
  autoSizeInput?: boolean;
@@ -84,6 +84,7 @@ var DatePickerInput = function (_a) {
84
84
  var $intent = _a.$intent;
85
85
  return (0, classNames_1.default)({
86
86
  'spr-focus-01': isOpen && $intent === 'default',
87
+ 'focus-within:spr-focus-01': $intent === 'default',
87
88
  'w-auto': autoSizeInput,
88
89
  });
89
90
  },
@@ -46,7 +46,7 @@ export var StyledCalendarHeader = styled('div', 'box-border spr-text-primary ite
46
46
  return ($density === DENSITY.high ? 'min-h-6.5 w-full' : 'min-h-9 w-98');
47
47
  });
48
48
  StyledCalendarHeader.displayName = 'StyledCalendarHeader';
49
- export var StyledMonthHeader = styled('div', 'spr-text-01 spr-bg-primary px-1 whitespace-no-wrap border-0 border-b-1 spr-border-secondary border-b-solid spr-text-primary block text-center flex justify-center');
49
+ export var StyledMonthHeader = styled('div', 'spr-text-01 spr-bg-primary px-1 whitespace-nowrap border-0 border-b-1 spr-border-secondary border-b-solid spr-text-primary block text-center flex justify-center');
50
50
  StyledMonthHeader.displayName = 'StyledMonthHeader';
51
51
  export var StyledMonthYearSelectButton = styled('button', 'px-2 gap-1 items-center justify-around flex cursor-pointer spr-bg-primary spr-text-01 h-8', 'border-1 spr-border-primary rounded-8 outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-[--spr-focus-01]');
52
52
  StyledMonthYearSelectButton.displayName = 'StyledMonthYearSelectButton';
@@ -54,7 +54,7 @@ export var StyledMonthYearSelectIconContainer = styled('span', 'flex items-cente
54
54
  StyledMonthYearSelectIconContainer.displayName = 'StyledMonthYearSelectIconContainer';
55
55
  export var StyledMonth = styled('div', 'inline-block w-full');
56
56
  StyledMonth.displayName = 'StyledMonth';
57
- export var StyledWeek = styled('div', 'mb-0.5 justify-center flex w-full whitespace-no-wrap');
57
+ export var StyledWeek = styled('div', 'mb-0.5 justify-center flex w-full whitespace-nowrap');
58
58
  StyledWeek.displayName = 'StyledWeek';
59
59
  // @ts-ignore
60
60
  function generateDayStyles(defaultCode, defaultStyle) {
@@ -1,7 +1,7 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import { type RGBColor } from 'react-color';
3
3
  import type { CustomColorSelectorProps } from './types';
4
- import { ClassName, Styles } from '../types';
4
+ import type { ClassName, Styles } from '../types';
5
5
  export declare const ColorPreview: ({ color, className, style, }: {
6
6
  color?: RGBColor | undefined;
7
7
  className?: ClassName;
@@ -5,7 +5,7 @@ import { CustomPicker } from 'react-color';
5
5
  import { Alpha, EditableInput, Hue, Saturation } from 'react-color/lib/components/common';
6
6
  import { Stack } from '../stack';
7
7
  import { Box } from '../box';
8
- import { hexToRgb, isValidHex } from '../helpers/colors';
8
+ import { hexToRgb, isValidHex, normalizeHexWithAlpha } from '../helpers/colors';
9
9
  import TransparentBackground from '../icon/components/transparentBackground';
10
10
  var CustomPointer = function () { return (_jsx(Box, { style: function (_a) {
11
11
  var rtlCompatible = _a.rtlCompatible;
@@ -48,6 +48,12 @@ var CustomEditableInput = function (_a) {
48
48
  var handleChange = useCallback(function (data) {
49
49
  typedValue.current = data;
50
50
  }, []);
51
+ useEffect(function () {
52
+ // Sync typedValue to value if value changes due to another input being edited
53
+ if (label in typedValue.current && typedValue.current[label] !== value) {
54
+ typedValue.current[label] = value;
55
+ }
56
+ }, [label, value]);
51
57
  useEffect(function () {
52
58
  if (!editableInput)
53
59
  return undefined;
@@ -82,21 +88,28 @@ var ColorPickerComponent = function (_props) {
82
88
  // but @types/react-color simply passes the types through CustomPicker as-is
83
89
  // We forward CustomColorSelectorProps to the component signature but internally use InternalCustomColorSelectorProps
84
90
  var props = _props;
85
- var hex = props.hex, rgb = props.rgb, enableAlphaSelector = props.enableAlphaSelector, onChange = props.onChange, onChangeComplete = props.onChangeComplete, renderColorSuggestionPanel = props.renderColorSuggestionPanel;
91
+ var _hex = props.hex, rgb = props.rgb, enableAlphaSelector = props.enableAlphaSelector, onChange = props.onChange, onChangeComplete = props.onChangeComplete, renderColorSuggestionPanel = props.renderColorSuggestionPanel;
86
92
  // Bug in the react-color lib
87
93
  // https://github.com/casesandberg/react-color/blob/bc9a0e1dc5d11b06c511a8e02a95bd85c7129f4b/src/helpers/hue.js#L33
88
94
  // when left === containerWidth it return 360 which return 0 in hsl value the pointer shifts to the left most
89
95
  // color which cause a flickering issue
90
96
  //https://github.com/casesandberg/react-color/blob/bc9a0e1dc5d11b06c511a8e02a95bd85c7129f4b/src/components/sketch/SketchFields.js#L51
91
97
  var _a = rgb !== null && rgb !== void 0 ? rgb : {}, r = _a.r, g = _a.g, b = _a.b, a = _a.a;
98
+ // react-color doesn't support alpha hexes, so we need to insert it ourselves
99
+ var hex = normalizeHexWithAlpha(_hex, a);
100
+ var handleHueChange = useCallback(function (data) {
101
+ // If alpha was zero and the saturation/lightness is changed, reset alpha to full
102
+ if ('a' in data && data.a === 0) {
103
+ onChange(__assign(__assign({}, data), { a: 1 }));
104
+ }
105
+ else
106
+ onChange(data);
107
+ }, [onChange]);
92
108
  var handleChange = useCallback(function (data) {
93
- var _a;
94
109
  // react-color emitted data is very dynamic and uses properties from labels
95
110
  if ('Hex' in data) {
96
- var hexValue = data.Hex;
97
- var alpha = (_a = (data.A < 100 ? data.A / 100 : a)) !== null && _a !== void 0 ? _a : 1;
98
- var newHex = alpha !== undefined && alpha !== 1 ? hexValue + Math.floor(alpha * 255).toString(16) : hexValue;
99
- var parsedRgba = hexToRgb(newHex);
111
+ var newHex = data.Hex;
112
+ var parsedRgba = hexToRgb(data.Hex);
100
113
  var newRgba = enableAlphaSelector ? parsedRgba : __assign(__assign({}, parsedRgba), { a: 1 }); // No alpha values when enableAlphaSelector is disabled
101
114
  onChange(newRgba);
102
115
  // No need to invoke onChange based on isValidHex as onChange is standard handler for react-color
@@ -105,17 +118,21 @@ var ColorPickerComponent = function (_props) {
105
118
  onChangeComplete({ rgb: newRgba });
106
119
  }
107
120
  else if (data.R || data.G || data.B || data.A) {
121
+ var _a = __read(Object.keys(data), 1), changedKey = _a[0];
122
+ // Reset alpha IF:
123
+ // Changed value is R/G/B AND current alpha is 0 AND new value is different from old value
124
+ var resetAlpha = changedKey !== 'A' && a === 0 && data[changedKey] !== { R: r, G: g, B: b }[changedKey];
108
125
  var newRgba = {
109
126
  r: getNumberWithFallback(data.R, r),
110
127
  g: getNumberWithFallback(data.G, g),
111
128
  b: getNumberWithFallback(data.B, b),
112
- a: enableAlphaSelector ? getNumberWithFallback(data.A, (a !== null && a !== void 0 ? a : 1) * 100) / 100 : 1,
129
+ a: enableAlphaSelector && !resetAlpha ? getNumberWithFallback(data.A, (a !== null && a !== void 0 ? a : 1) * 100) / 100 : 1,
113
130
  };
114
131
  onChange(newRgba);
115
132
  onChangeComplete({ rgb: newRgba });
116
133
  }
117
134
  }, [onChange, onChangeComplete, enableAlphaSelector, r, g, b, a]);
118
- return (_jsxs(Stack, __assign({ direction: "vertical", gap: 4 }, { children: [renderColorSuggestionPanel ? renderColorSuggestionPanel(hex) : null, _jsx(Box, __assign({ className: "relative w-full rounded-16 overflow-hidden", style: { height: '150px' } }, { children: _jsx(Saturation, __assign({}, props)) })), _jsxs(Stack, __assign({ direction: "vertical", gap: 2 }, { children: [_jsx(Box, __assign({ className: "flex gap-2 justify-between ml-2" }, { children: _jsxs(Box, __assign({ className: "flex flex-col items-start gap-2" }, { children: [_jsxs(Box, __assign({ className: "flex items-center gap-2" }, { children: [_jsx(Box, __assign({ className: "relative h-3", style: { width: enableAlphaSelector ? '261px' : '228px' } }, { children: _jsx(Hue, __assign({ pointer: CustomPointer, radius: "24px" }, props)) })), _jsx(ColorPreview, { color: rgb })] })), enableAlphaSelector ? (_jsx(Box, __assign({ className: "relative h-3", style: { width: '261px' } }, { children: _jsx(Alpha, __assign({ pointer: CustomPointer, radius: "24px", style: { container: { margin: 0 } } }, props)) }))) : null] })) })), _jsxs(Box, __assign({ className: "grid w-full gap-2",
135
+ return (_jsxs(Stack, __assign({ direction: "vertical", gap: 4 }, { children: [renderColorSuggestionPanel ? renderColorSuggestionPanel(hex) : null, _jsx(Box, __assign({ className: "relative w-full h-32 rounded-16 overflow-hidden", style: { height: '150px' } }, { children: _jsx(Saturation, __assign({}, props, { onChange: handleHueChange })) })), _jsxs(Stack, __assign({ direction: "vertical", gap: 2 }, { children: [_jsx(Box, __assign({ className: "flex gap-2 justify-between ml-2" }, { children: _jsxs(Box, __assign({ className: "flex flex-col items-start gap-2" }, { children: [_jsxs(Box, __assign({ className: "flex items-center gap-2" }, { children: [_jsx(Box, __assign({ className: "relative h-3", style: { width: enableAlphaSelector ? '261px' : '228px' } }, { children: _jsx(Hue, __assign({ pointer: CustomPointer, radius: "24px" }, props, { onChange: handleHueChange })) })), _jsx(ColorPreview, { color: rgb })] })), enableAlphaSelector ? (_jsx(Box, __assign({ className: "relative h-3", style: { width: '261px' } }, { children: _jsx(Alpha, __assign({ pointer: CustomPointer, radius: "24px", style: { container: { margin: 0 } } }, props)) }))) : null] })) })), _jsxs(Box, __assign({ className: "grid w-full gap-2",
119
136
  // 5 columns with alpha, 4 columns without
120
137
  style: {
121
138
  gridTemplateColumns: "".concat(enableAlphaSelector ? '73' : '99', "fr").concat(' 51fr'.repeat(enableAlphaSelector ? 4 : 3)),
@@ -1,5 +1,5 @@
1
- import { ReactElement } from 'react';
2
- import { InputProps } from '../input';
1
+ import { type ReactElement } from 'react';
2
+ import { type InputProps } from '../input';
3
3
  type DatePickerInputProps = InputProps & {
4
4
  isOpen?: boolean;
5
5
  autoSizeInput?: boolean;
@@ -79,6 +79,7 @@ var DatePickerInput = function (_a) {
79
79
  var $intent = _a.$intent;
80
80
  return cx({
81
81
  'spr-focus-01': isOpen && $intent === 'default',
82
+ 'focus-within:spr-focus-01': $intent === 'default',
82
83
  'w-auto': autoSizeInput,
83
84
  });
84
85
  },
@@ -16,3 +16,4 @@ export declare function getContrastRatio(color1: string, color2: string): number
16
16
  export declare function RgbToHsl({ r, g, b, a }: RGBColor): HSLA;
17
17
  export declare function HslToRgb(hsl: HSLA): RGBColor;
18
18
  export declare function noAlphaHex(inputHex?: string): string | undefined;
19
+ export declare function normalizeHexWithAlpha<T extends string | undefined>(hex: T, alpha: number | undefined): T;
@@ -14,18 +14,19 @@ export var isValidHex = function (hex) {
14
14
  * @return {{r, g, b, a}} an object with rgba
15
15
  */
16
16
  export function hexToRgb(_hex) {
17
- var hex = _hex.replace(/^#?/, '#');
17
+ var hex = _hex.replace(/^#?/, '');
18
18
  if (!isValidHex(hex))
19
19
  return { r: 0, g: 0, b: 0 };
20
20
  var isShortHand = hex.length === 3 || hex.length === 4;
21
- var r = parseInt(isShortHand ? hex.substring(1, 2).repeat(2) : hex.substring(1, 3), 16);
22
- var g = parseInt(isShortHand ? hex.substring(2, 3).repeat(2) : hex.substring(3, 5), 16);
23
- var b = parseInt(isShortHand ? hex.substring(3, 4).repeat(2) : hex.substring(5, 7), 16);
24
- var a = parseInt(isShortHand ? hex.substring(4, 5).repeat(2) : hex.substring(7, 9), 16);
21
+ var r = parseInt(isShortHand ? hex.substring(0, 1).repeat(2) : hex.substring(0, 2), 16);
22
+ var g = parseInt(isShortHand ? hex.substring(1, 2).repeat(2) : hex.substring(2, 4), 16);
23
+ var b = parseInt(isShortHand ? hex.substring(2, 3).repeat(2) : hex.substring(4, 6), 16);
24
+ var a = parseInt(isShortHand ? hex.substring(3, 4).repeat(2) : hex.substring(6, 8), 16);
25
25
  return __assign({ r: r, g: g, b: b }, (a < 255 ? { a: a / 255 } : undefined));
26
26
  }
27
27
  export function RgbToHex(_a) {
28
28
  var r = _a.r, g = _a.g, b = _a.b, a = _a.a;
29
+ // eslint-disable-next-line react-google-translate/no-return-text-nodes -- This isn't a React Element
29
30
  return "#".concat(__spreadArray([r, g, b], __read((a < 1 ? [Math.round(a * 255)] : [])), false).map(function (n) { return (Number.isNaN(n) ? 10 : Math.round(Math.min(Math.max(n, 0), 255))).toString(16).padStart(2, '0'); })
30
31
  .join(''));
31
32
  }
@@ -84,3 +85,11 @@ export function noAlphaHex(inputHex) {
84
85
  return inputHex.slice(0, -2);
85
86
  return inputHex;
86
87
  }
88
+ export function normalizeHexWithAlpha(hex, alpha) {
89
+ if (typeof alpha !== 'number' || alpha === 1 || !hex)
90
+ return hex;
91
+ return (hex +
92
+ Math.floor(alpha * 255)
93
+ .toString(16)
94
+ .padStart(2, '0'));
95
+ }
@@ -6,6 +6,7 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
6
6
  } & {
7
7
  children?: React.ReactNode;
8
8
  virtual?: boolean | undefined;
9
+ keepFirstItemMounted?: boolean | undefined;
9
10
  overrides?: {
10
11
  Root?: import("../overrides").Override<Record<string, any>> | undefined;
11
12
  } | undefined;
package/esm/list/list.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { __assign, __read, __rest } from "tslib";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as React from 'react';
4
- import { useVirtualizer } from '@tanstack/react-virtual';
4
+ import { useVirtualizer, defaultRangeExtractor } from '@tanstack/react-virtual';
5
5
  import { useOverrides } from '../overrides';
6
6
  import useCombinedRef, { combineRefs } from '../hooks/useCombinedRef';
7
7
  import { LIST_MIN_WIDTH, StyledList } from './styled-component';
8
8
  import { Box } from '../box';
9
- import { measureElement } from './utils';
9
+ import { customRangeExtractor, measureElement } from './utils';
10
10
  import { DEFAULT_LIST_ITEM_HEIGHT, DEFAULT_OVER_SCAN_COUNT } from './constants';
11
11
  import { useStyle } from '../style';
12
12
  var getCloneElement = function (item, virtualRow, totalCount) {
@@ -21,8 +21,8 @@ var getCloneElement = function (item, virtualRow, totalCount) {
21
21
  });
22
22
  };
23
23
  var List = React.forwardRef(function (_a, forwardedRef) {
24
- var _b = _a.overrides, overrides = _b === void 0 ? {} : _b, children = _a.children, virtual = _a.virtual, scrollElement = _a.scrollElement, _c = _a.overscanCount, overscanCount = _c === void 0 ? DEFAULT_OVER_SCAN_COUNT : _c, _d = _a.estimateItemSize, estimateItemSize = _d === void 0 ? DEFAULT_LIST_ITEM_HEIGHT : _d, _e = _a.role, role = _e === void 0 ? 'list' : _e, autoScrollToSelectedItem = _a.autoScrollToSelectedItem, style = _a.style, className = _a.className, restProps = __rest(_a, ["overrides", "children", "virtual", "scrollElement", "overscanCount", "estimateItemSize", "role", "autoScrollToSelectedItem", "style", "className"]);
25
- var _f = __read(useOverrides(overrides.Root, StyledList), 2), Root = _f[0], rootProps = _f[1];
24
+ var _b = _a.overrides, overrides = _b === void 0 ? {} : _b, children = _a.children, virtual = _a.virtual, scrollElement = _a.scrollElement, _c = _a.overscanCount, overscanCount = _c === void 0 ? DEFAULT_OVER_SCAN_COUNT : _c, _d = _a.estimateItemSize, estimateItemSize = _d === void 0 ? DEFAULT_LIST_ITEM_HEIGHT : _d, _e = _a.role, role = _e === void 0 ? 'list' : _e, autoScrollToSelectedItem = _a.autoScrollToSelectedItem, style = _a.style, className = _a.className, _f = _a.keepFirstItemMounted, keepFirstItemMounted = _f === void 0 ? false : _f, restProps = __rest(_a, ["overrides", "children", "virtual", "scrollElement", "overscanCount", "estimateItemSize", "role", "autoScrollToSelectedItem", "style", "className", "keepFirstItemMounted"]);
25
+ var _g = __read(useOverrides(overrides.Root, StyledList), 2), Root = _g[0], rootProps = _g[1];
26
26
  var parentRef = React.useRef(null);
27
27
  var combinedRef = useCombinedRef(parentRef, forwardedRef);
28
28
  var childrenArr = React.Children.toArray(children);
@@ -33,6 +33,7 @@ var List = React.forwardRef(function (_a, forwardedRef) {
33
33
  estimateSize: function () { return estimateItemSize; },
34
34
  overscan: overscanCount,
35
35
  measureElement: measureElement,
36
+ rangeExtractor: keepFirstItemMounted ? customRangeExtractor : defaultRangeExtractor,
36
37
  });
37
38
  React.useEffect(function () {
38
39
  if (!autoScrollToSelectedItem) {
@@ -1,7 +1,7 @@
1
- import { KeyboardEvent, MouseEvent, ReactNode } from 'react';
2
- import { Override } from '../overrides/types';
3
- import { SpacewebComponentProps } from '../types';
4
- import { StatefulTooltipProps } from '../tooltip';
1
+ import type { KeyboardEvent, MouseEvent, ReactNode } from 'react';
2
+ import type { Override } from '../overrides/types';
3
+ import type { SpacewebComponentProps } from '../types';
4
+ import type { StatefulTooltipProps } from '../tooltip';
5
5
  export type AlignItems = 'start' | 'center';
6
6
  export type Enhancer<SharedProps> = ReactNode | ((props: SharedProps) => ReactNode);
7
7
  export type ListItemSharedProps = {
@@ -36,6 +36,10 @@ export type ListItemProps = SpacewebComponentProps & {
36
36
  export type ListProps = SpacewebComponentProps & {
37
37
  children?: ReactNode;
38
38
  virtual?: boolean;
39
+ /**
40
+ * Forces the first item to stay mounted even when out of overscan range in virtualized list
41
+ */
42
+ keepFirstItemMounted?: boolean;
39
43
  overrides?: {
40
44
  Root?: Override<Record<string, any>>;
41
45
  };
@@ -1,2 +1,6 @@
1
- import type { measureElement as measureElementType } from '@tanstack/react-virtual';
1
+ import type { measureElement as measureElementType, Range } from '@tanstack/react-virtual';
2
2
  export declare const measureElement: typeof measureElementType;
3
+ /**
4
+ * Keeps the first item mounted even when it falls outside the range.
5
+ */
6
+ export declare const customRangeExtractor: (range: Range) => number[];
package/esm/list/utils.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { __read, __spreadArray } from "tslib";
2
+ import { defaultRangeExtractor } from '@tanstack/react-virtual';
1
3
  var parseMeasurement = function (str) { return parseFloat(str) || 0; };
2
4
  // by default react-virtual uses getBoundingClientRect to calculate dimensions.
3
5
  // overriding it to use height + margin, so that we do not have to wrap each ListItem with another element
@@ -8,3 +10,16 @@ export var measureElement = function (element, instance) {
8
10
  var boundingRect = element.getBoundingClientRect();
9
11
  return instance.options.horizontal ? boundingRect.width + marginX : boundingRect.height + marginY;
10
12
  };
13
+ /**
14
+ * Keeps the first item mounted even when it falls outside the range.
15
+ */
16
+ export var customRangeExtractor = function (range) {
17
+ var defaultIndices = defaultRangeExtractor(range);
18
+ // Find the actual start index of the range including overscan
19
+ var virtualRangeStart = Math.max(range.startIndex - range.overscan, 0);
20
+ // If the first item is already in the virtual range, return the default indices.
21
+ if (virtualRangeStart === 0)
22
+ return defaultIndices;
23
+ // Otherwise, prepend the first item to the default indices.
24
+ return __spreadArray([0], __read(defaultIndices), false);
25
+ };
@@ -1,5 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { type IconButtonProps } from '../button';
3
- export type ActionsIconButtonProps = IconButtonProps;
4
- declare const ActionsIconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
3
+ export type ActionsIconButtonProps = IconButtonProps & {
4
+ /** When true, the action stays visible even when the row is not hovered or keyboard-highlighted. */
5
+ alwaysVisible?: boolean;
6
+ };
7
+ declare const ActionsIconButton: import("react").ForwardRefExoticComponent<ActionsIconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
5
8
  export default ActionsIconButton;
@@ -31,6 +31,7 @@ declare const StatefulSubMenu: import("react").ForwardRefExoticComponent<Omit<Me
31
31
  } & {
32
32
  children?: ReactNode;
33
33
  virtual?: boolean | undefined;
34
+ keepFirstItemMounted?: boolean | undefined;
34
35
  overrides?: {
35
36
  Root?: Override<Record<string, any>> | undefined;
36
37
  } | undefined;
@@ -32,6 +32,7 @@ declare const SubMenu: import("react").ForwardRefExoticComponent<Omit<MenuProps,
32
32
  } & {
33
33
  children?: ReactNode;
34
34
  virtual?: boolean | undefined;
35
+ keepFirstItemMounted?: boolean | undefined;
35
36
  overrides?: {
36
37
  Root?: Override<Record<string, any>> | undefined;
37
38
  } | undefined;
@@ -34,7 +34,8 @@ var SubMenu = forwardRef(function (_a, ref) {
34
34
  var itemsToRender = items.length
35
35
  ? _flatten(items.map(function (item) { var _a; return (_a = itemRenderer === null || itemRenderer === void 0 ? void 0 : itemRenderer(item, onItemSelect)) !== null && _a !== void 0 ? _a : defaultItemRenderer(item, onItemSelect); }))
36
36
  : (_c = emptyStateRenderer === null || emptyStateRenderer === void 0 ? void 0 : emptyStateRenderer(currentHeaderItem)) !== null && _c !== void 0 ? _c : null;
37
- return (_jsxs(MenuOverriden, __assign({ "aria-label": "Menu" }, props, menuProps, { ref: ref }, { children: [currentHeaderItem && (_jsxs(_Fragment, { children: [_jsx(Box, { ref: setStickySentinelRef }), _jsx(HeaderMenuItem, __assign({ startEnhancer: _jsx(ChevronLeft, {}), "aria-label": locale.menu.subMenuBackButtonAriaLabel }, (_b = {}, _b[SUBMENU_BACK_ROW_ATTR] = '', _b), menuItemProps, { className: [
37
+ var shouldPinHeader = !!(props.virtual && currentHeaderItem !== undefined);
38
+ return (_jsxs(MenuOverriden, __assign({ "aria-label": "Menu" }, props, menuProps, { keepFirstItemMounted: shouldPinHeader, ref: ref }, { children: [currentHeaderItem && (_jsxs(_Fragment, { children: [_jsx(Box, { ref: setStickySentinelRef }), _jsx(HeaderMenuItem, __assign({ startEnhancer: _jsx(ChevronLeft, {}), "aria-label": locale.menu.subMenuBackButtonAriaLabel }, (_b = {}, _b[SUBMENU_BACK_ROW_ATTR] = '', _b), menuItemProps, { className: [
38
39
  'sticky top-0 w-full z-1 mb-1',
39
40
  function (_, _a) {
40
41
  var $highlighted = _a.$highlighted;
@@ -1,5 +1,5 @@
1
1
  import { __assign, __read, __rest } from "tslib";
2
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
4
4
  import * as React from 'react';
5
5
  import { Box } from '../box';
@@ -62,7 +62,9 @@ var ACTION_CONTAINER_HANDLER_PROPS = {
62
62
  };
63
63
  function MenuActionContainer(_a) {
64
64
  var sharedProps = _a.sharedProps, endEnhancer = _a.endEnhancer, renderedActions = _a.renderedActions;
65
- return (_jsxs(Box, __assign({ className: cx('flex items-center gap-1 opacity-0 pointer-events-none', 'group-hover:opacity-100 group-hover:pointer-events-auto', 'group-focus-within:opacity-100 group-focus-within:pointer-events-auto', sharedProps.$highlighted ? 'opacity-100 pointer-events-auto' : ''), "data-menu-action-container": "true", role: "group" }, ACTION_CONTAINER_HANDLER_PROPS, { children: [renderedActions, typeof endEnhancer === 'function' ? endEnhancer(sharedProps) : endEnhancer !== null && endEnhancer !== void 0 ? endEnhancer : null] })));
65
+ return (_jsxs(Box, __assign({ className: cx('flex items-center gap-1 pointer-events-none', 'group-hover:visible group-hover:pointer-events-auto', 'group-focus-within:visible group-focus-within:pointer-events-auto',
66
+ // Use visibility (not opacity) so alwaysVisible children can override with `visible`.
67
+ sharedProps.$highlighted ? 'visible pointer-events-auto' : 'invisible'), "data-menu-action-container": "true", role: "group" }, ACTION_CONTAINER_HANDLER_PROPS, { children: [renderedActions.map(function (action) { return (_jsx(Box, __assign({ className: action.props.alwaysVisible ? 'visible opacity-100 pointer-events-auto' : undefined }, { children: action }), action.key)); }), typeof endEnhancer === 'function' ? endEnhancer(sharedProps) : endEnhancer !== null && endEnhancer !== void 0 ? endEnhancer : null] })));
66
68
  }
67
69
  function buildListItemAriaProps(itemRole, selected, ChildMenu) {
68
70
  var props = {};
@@ -74,20 +76,28 @@ function buildListItemAriaProps(itemRole, selected, ChildMenu) {
74
76
  }
75
77
  return props;
76
78
  }
79
+ function flattenActionElements(actions) {
80
+ return React.Children.toArray(actions).flatMap(function (node) {
81
+ if (React.isValidElement(node)) {
82
+ return node.type === React.Fragment ? flattenActionElements(node.props.children) : [node];
83
+ }
84
+ return [];
85
+ });
86
+ }
77
87
  function useResolvedMenuEndEnhancer(resolvedItemActions, shouldRenderActions, endEnhancer, ChildMenu) {
78
88
  var renderedActions = useMemo(function () {
79
89
  return shouldRenderActions
80
- ? React.Children.map(resolvedItemActions, function (action, index) {
90
+ ? flattenActionElements(resolvedItemActions).map(function (action, index) {
81
91
  var _a;
82
- if (!React.isValidElement(action))
83
- return action;
84
- return React.cloneElement(action, { key: (_a = action.key) !== null && _a !== void 0 ? _a : "menu-action-".concat(index) });
92
+ return React.cloneElement(action, {
93
+ key: (_a = action.key) !== null && _a !== void 0 ? _a : "menu-action-".concat(index),
94
+ });
85
95
  })
86
96
  : null;
87
97
  }, [resolvedItemActions, shouldRenderActions]);
88
98
  return useMemo(function () {
89
99
  if (shouldRenderActions) {
90
- return function (sharedProps) { return (_jsx(MenuActionContainer, { sharedProps: sharedProps, endEnhancer: endEnhancer, renderedActions: renderedActions })); };
100
+ return function (sharedProps) { return (_jsx(MenuActionContainer, { sharedProps: sharedProps, endEnhancer: endEnhancer, renderedActions: renderedActions !== null && renderedActions !== void 0 ? renderedActions : [] })); };
91
101
  }
92
102
  if (endEnhancer)
93
103
  return endEnhancer;
@@ -14,6 +14,7 @@ declare const _default: import("react").MemoExoticComponent<import("react").Forw
14
14
  } & {
15
15
  children?: import("react").ReactNode;
16
16
  virtual?: boolean | undefined;
17
+ keepFirstItemMounted?: boolean | undefined;
17
18
  overrides?: {
18
19
  Root?: import("../overrides").Override<Record<string, any>> | undefined;
19
20
  } | undefined;
@@ -1,7 +1,7 @@
1
- import { ReactElement } from 'react';
2
- import { CircularProgressProps } from './types';
1
+ import type { ReactElement } from 'react';
2
+ import type { CircularProgressProps } from './types';
3
3
  declare const CircularProgress: {
4
- ({ intent, infinite, label, backgroundColor, value, className, style, color, size, thickness, overrides, }: CircularProgressProps): ReactElement;
4
+ ({ intent, infinite, label, backgroundColor, value, className, style, color, size, thickness, overrides, ...restProps }: CircularProgressProps): ReactElement;
5
5
  __standard: string;
6
6
  };
7
7
  export default CircularProgress;
@@ -1,4 +1,4 @@
1
- import { __assign, __read } from "tslib";
1
+ import { __assign, __read, __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { add$props } from '../../helpers';
4
4
  import { useOverrides } from '../../overrides';
@@ -6,7 +6,7 @@ import { StyledBar, StyledBarContainer, StyledLabel, StyledLabelContainer, Style
6
6
  import { useStyle } from '../../style';
7
7
  import { getIntentColor } from '../helper';
8
8
  var CircularProgress = function (_a) {
9
- var _b = _a.intent, intent = _b === void 0 ? 'default' : _b, _c = _a.infinite, infinite = _c === void 0 ? false : _c, label = _a.label, backgroundColor = _a.backgroundColor, _d = _a.value, value = _d === void 0 ? 0 : _d, className = _a.className, style = _a.style, color = _a.color, _e = _a.size, size = _e === void 0 ? 50 : _e, _f = _a.thickness, thickness = _f === void 0 ? 3 : _f, overrides = _a.overrides;
9
+ var _b = _a.intent, intent = _b === void 0 ? 'default' : _b, _c = _a.infinite, infinite = _c === void 0 ? false : _c, label = _a.label, backgroundColor = _a.backgroundColor, _d = _a.value, value = _d === void 0 ? 0 : _d, className = _a.className, style = _a.style, color = _a.color, _e = _a.size, size = _e === void 0 ? 50 : _e, _f = _a.thickness, thickness = _f === void 0 ? 3 : _f, overrides = _a.overrides, restProps = __rest(_a, ["intent", "infinite", "label", "backgroundColor", "value", "className", "style", "color", "size", "thickness", "overrides"]);
10
10
  var strokeWidth = (VIEWBOX_SIZE / size) * thickness;
11
11
  var _g = useStyle(), px2rem = _g.px2rem, theme = _g.theme;
12
12
  var sharedProps = __assign(__assign({}, add$props({ intent: intent, infinite: infinite, backgroundColor: backgroundColor, value: value, color: color, size: size, thickness: thickness, strokeWidth: strokeWidth })), { $withLabel: !!label });
@@ -17,7 +17,7 @@ var CircularProgress = function (_a) {
17
17
  var _m = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Progress, StyledProgress), 2), Progress = _m[0], progressProps = _m[1];
18
18
  var _o = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.LabelContainer, StyledLabelContainer), 2), LabelContainer = _o[0], labelContainerProps = _o[1];
19
19
  var _p = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Label, StyledLabel), 2), Label = _p[0], labelProps = _p[1];
20
- return (_jsxs(Root, __assign({ role: "progressbar", "aria-valuenow": !infinite ? Math.round(value) : undefined, "aria-valuemin": !infinite ? 0 : undefined, "aria-valuemax": !infinite ? 100 : undefined }, sharedProps, rootProps, { style: [
20
+ return (_jsxs(Root, __assign({ role: "progressbar", "aria-valuenow": !infinite ? Math.round(value) : undefined, "aria-valuemin": !infinite ? 0 : undefined, "aria-valuemax": !infinite ? 100 : undefined }, sharedProps, restProps, rootProps, { style: [
21
21
  {
22
22
  '--sw-height': px2rem(size),
23
23
  '--sw-width': px2rem(size),
@@ -1,7 +1,7 @@
1
- import { ReactElement, PropsWithChildren } from 'react';
2
- import { LinearProgressProps } from './types';
1
+ import type { ReactElement, PropsWithChildren } from 'react';
2
+ import type { LinearProgressProps } from './types';
3
3
  declare const LinearProgress: {
4
- ({ intent, value, backgroundColor, color, label, style, className, infinite, overrides, children, }: PropsWithChildren<LinearProgressProps>): ReactElement;
4
+ ({ intent, value, backgroundColor, color, label, style, className, infinite, overrides, children, ...restProps }: PropsWithChildren<LinearProgressProps>): ReactElement;
5
5
  __standard: string;
6
6
  };
7
7
  export default LinearProgress;
@@ -1,4 +1,4 @@
1
- import { __assign, __read } from "tslib";
1
+ import { __assign, __read, __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { add$props } from '../../helpers';
4
4
  import { useOverrides } from '../../overrides';
@@ -6,14 +6,14 @@ import { StyledBar, StyledLabel, StyledProgress, StyledRoot } from './styled-com
6
6
  import { getIntentColor } from '../helper';
7
7
  import { useStyle } from '../../style';
8
8
  var LinearProgress = function (_a) {
9
- var _b = _a.intent, intent = _b === void 0 ? 'default' : _b, _c = _a.value, value = _c === void 0 ? 0 : _c, backgroundColor = _a.backgroundColor, color = _a.color, label = _a.label, style = _a.style, className = _a.className, _d = _a.infinite, infinite = _d === void 0 ? false : _d, overrides = _a.overrides, children = _a.children;
9
+ var _b = _a.intent, intent = _b === void 0 ? 'default' : _b, _c = _a.value, value = _c === void 0 ? 0 : _c, backgroundColor = _a.backgroundColor, color = _a.color, label = _a.label, style = _a.style, className = _a.className, _d = _a.infinite, infinite = _d === void 0 ? false : _d, overrides = _a.overrides, children = _a.children, restProps = __rest(_a, ["intent", "value", "backgroundColor", "color", "label", "style", "className", "infinite", "overrides", "children"]);
10
10
  var sharedProps = __assign(__assign({}, add$props({ intent: intent, value: value, backgroundColor: backgroundColor, color: color, infinite: infinite })), { $withLabel: !!label });
11
11
  var theme = useStyle().theme;
12
12
  var _e = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Root, StyledRoot), 2), Root = _e[0], rootProps = _e[1];
13
13
  var _f = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Bar, StyledBar), 2), Bar = _f[0], barProps = _f[1];
14
14
  var _g = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Progress, StyledProgress), 2), Progress = _g[0], progressProps = _g[1];
15
15
  var _h = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Label, StyledLabel), 2), Label = _h[0], labelProps = _h[1];
16
- return (_jsxs(Root, __assign({ "data-spaceweb": "linear-progress", role: "progressbar", "aria-valuenow": !infinite ? Math.round(value) : undefined, "aria-valuemin": !infinite ? 0 : undefined, "aria-valuemax": !infinite ? 100 : undefined }, sharedProps, rootProps, { style: [style, rootProps === null || rootProps === void 0 ? void 0 : rootProps.style], className: [className, rootProps === null || rootProps === void 0 ? void 0 : rootProps.className] }, { children: [_jsx(Bar, __assign({ "data-testid": "track" }, sharedProps, barProps, { style: [{ '--sw-bg-color': backgroundColor || theme.spr.tag02 }, barProps === null || barProps === void 0 ? void 0 : barProps.style] }, { children: children || (_jsx(Progress, __assign({ "data-testid": "filled-track" }, sharedProps, progressProps, { style: [
16
+ return (_jsxs(Root, __assign({ "data-spaceweb": "linear-progress", role: "progressbar", "aria-valuenow": !infinite ? Math.round(value) : undefined, "aria-valuemin": !infinite ? 0 : undefined, "aria-valuemax": !infinite ? 100 : undefined }, sharedProps, restProps, rootProps, { style: [style, rootProps === null || rootProps === void 0 ? void 0 : rootProps.style], className: [className, rootProps === null || rootProps === void 0 ? void 0 : rootProps.className] }, { children: [_jsx(Bar, __assign({ "data-testid": "track" }, sharedProps, barProps, { style: [{ '--sw-bg-color': backgroundColor || theme.spr.tag02 }, barProps === null || barProps === void 0 ? void 0 : barProps.style] }, { children: children || (_jsx(Progress, __assign({ "data-testid": "filled-track" }, sharedProps, progressProps, { style: [
17
17
  __assign({ '--sw-bg-color': color || getIntentColor(intent, theme) }, (!infinite ? { '--sw-width': "".concat(value, "%") } : {})),
18
18
  progressProps === null || progressProps === void 0 ? void 0 : progressProps.style,
19
19
  ] }))) })), label ? (_jsx(Label, __assign({}, sharedProps, labelProps, { children: typeof label === 'function' ? label(sharedProps) : label }))) : null] })));