@ssa-ui-kit/core 2.31.0 → 2.32.0-canary-b64be64-20251219

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 (59) hide show
  1. package/dist/components/Charts/BarLineComplexChart/BarLineComplexChartView.d.ts +2 -2
  2. package/dist/components/Charts/BarLineComplexChart/types.d.ts +2 -2
  3. package/dist/components/Charts/BigNumberChart/BigNumberChart.d.ts +4 -2
  4. package/dist/components/Charts/BigNumberChart/components/TrendLine.d.ts +8 -3
  5. package/dist/components/Charts/BigNumberChart/components/TrendLineTooltip.d.ts +8 -5
  6. package/dist/components/Charts/GaugeChart/components/GaugeChartBase.d.ts +3 -1
  7. package/dist/components/Charts/PieChart/types.d.ts +1 -1
  8. package/dist/components/Charts/RadarChart/RadarChart.d.ts +1 -1
  9. package/dist/components/Charts/TreeMapChart/TreeMapChart.d.ts +1 -1
  10. package/dist/components/Charts/index.d.ts +1 -0
  11. package/dist/components/Charts/utils/nivoReact19Compat.d.ts +13 -0
  12. package/dist/components/Checkbox/types.d.ts +2 -2
  13. package/dist/components/CollapsibleNavBar/components/TriggerIcon.d.ts +4 -2
  14. package/dist/components/DatePicker/styles.d.ts +0 -1
  15. package/dist/components/DateRangePicker/DateRangePicker.d.ts +1 -1
  16. package/dist/components/DateRangePicker/components/DatesListWrapper.d.ts +0 -1
  17. package/dist/components/DateRangePicker/components/TriggerInput.d.ts +1 -4
  18. package/dist/components/DateRangePicker/hooks/index.d.ts +1 -0
  19. package/dist/components/DateRangePicker/hooks/useDatePickerMask.d.ts +3 -9
  20. package/dist/components/DateRangePicker/hooks/useDateRangePicker.d.ts +21 -18
  21. package/dist/components/DateRangePicker/hooks/useRangeSelection.d.ts +20 -0
  22. package/dist/components/DateRangePicker/styles.d.ts +0 -2
  23. package/dist/components/DateRangePicker/types.d.ts +6 -4
  24. package/dist/components/DateRangePicker/useDateRangePickerContext.d.ts +2 -1
  25. package/dist/components/Field/FieldControl.d.ts +1 -1
  26. package/dist/components/Filters/FilterBlockWrapper.d.ts +0 -1
  27. package/dist/components/Filters/FiltersContext.d.ts +4 -4
  28. package/dist/components/Filters/hooks/useVisibility.d.ts +2 -2
  29. package/dist/components/Indicator/types.d.ts +4 -2
  30. package/dist/components/JsonSchemaForm/constants.d.ts +1 -0
  31. package/dist/components/JsonSchemaForm/index.d.ts +2 -0
  32. package/dist/components/JsonSchemaForm/types.d.ts +6 -0
  33. package/dist/components/ModalDismissButton/ModalDismissButton.d.ts +2 -2
  34. package/dist/components/ModalOpenButton/ModalOpenButton.d.ts +1 -1
  35. package/dist/components/NavBar/types.d.ts +1 -1
  36. package/dist/components/NotificationMenu/types.d.ts +3 -3
  37. package/dist/components/Pagination/WithPagination.d.ts +2 -4
  38. package/dist/components/PersonInfo/PersonInfoAvatar.d.ts +1 -8
  39. package/dist/components/PersonInfo/PersonInfoCounter.d.ts +3 -0
  40. package/dist/components/PersonInfo/PersonInfoValue.d.ts +1 -8
  41. package/dist/components/PersonInfo/helpers.d.ts +11 -0
  42. package/dist/components/PersonInfo/styles.d.ts +29 -14
  43. package/dist/components/PersonInfo/types.d.ts +31 -1
  44. package/dist/components/TableFilters/hooks/useTableData.d.ts +3 -3
  45. package/dist/components/Tooltip/SimpleChartTooltip.d.ts +2 -1
  46. package/dist/components/Tooltip/types.d.ts +6 -5
  47. package/dist/components/TooltipTrigger/TooltipTrigger.d.ts +1 -1
  48. package/dist/components/Typeahead/Typeahead.context.d.ts +4 -4
  49. package/dist/components/Typeahead/styles.d.ts +0 -1
  50. package/dist/components/Typeahead/useTypeahead.d.ts +4 -4
  51. package/dist/components/UserProfile/styles.d.ts +0 -2
  52. package/dist/components/UserProfile/types.d.ts +1 -1
  53. package/dist/components/WithLink.d.ts +1 -1
  54. package/dist/components/Wrapper/Wrapper.d.ts +0 -1
  55. package/dist/index.d.ts +1 -0
  56. package/dist/index.js +774 -412
  57. package/dist/index.js.map +1 -1
  58. package/dist/utils/react19HocCompat.d.ts +14 -0
  59. package/package.json +30 -30
package/dist/index.js CHANGED
@@ -248,6 +248,7 @@ __webpack_require__.d(__webpack_exports__, {
248
248
  iconsList: () => (/* reexport */ iconsList),
249
249
  mainTheme: () => (/* reexport */ themes_main),
250
250
  pieChartPalettes: () => (/* reexport */ colorPalettes_namespaceObject),
251
+ setHocDisplayName: () => (/* reexport */ setHocDisplayName),
251
252
  styleUtils: () => (/* reexport */ safari_focus_outline_namespaceObject),
252
253
  styles: () => (/* reexport */ Tooltip_styles_namespaceObject),
253
254
  useAccordionGroupContext: () => (/* reexport */ useAccordionGroupContext),
@@ -267,7 +268,8 @@ __webpack_require__.d(__webpack_exports__, {
267
268
  useTooltip: () => (/* reexport */ useTooltip),
268
269
  useTooltipContext: () => (/* reexport */ useTooltipContext),
269
270
  useTranslation: () => (/* reexport */ useTranslation),
270
- useTypeaheadContext: () => (/* reexport */ useTypeaheadContext)
271
+ useTypeaheadContext: () => (/* reexport */ useTypeaheadContext),
272
+ wrapNivoResponsiveComponent: () => (/* reexport */ wrapNivoResponsiveComponent)
271
273
  });
272
274
 
273
275
  // NAMESPACE OBJECT: ./src/styles/global.ts
@@ -1102,6 +1104,7 @@ __webpack_require__.d(Field_index_parts_namespaceObject, {
1102
1104
  var JsonSchemaForm_namespaceObject = {};
1103
1105
  __webpack_require__.r(JsonSchemaForm_namespaceObject);
1104
1106
  __webpack_require__.d(JsonSchemaForm_namespaceObject, {
1107
+ DEFAULT_AVATAR_SIZE: () => (DEFAULT_AVATAR_SIZE),
1105
1108
  Fields: () => (fields),
1106
1109
  Form: () => (JsonSchemaForm_Form),
1107
1110
  Templates: () => (templates),
@@ -4766,6 +4769,8 @@ const DropdownOptions = ({
4766
4769
  activeItem
4767
4770
  } = useDropdownContext();
4768
4771
  const childrenArray = external_react_default().Children.toArray(children).filter(Boolean);
4772
+
4773
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4769
4774
  const options = childrenArray.map(child => {
4770
4775
  const isActive = activeItem?.value === child.props.value;
4771
4776
  return /*#__PURE__*/external_react_default().cloneElement(child, {
@@ -4881,6 +4886,8 @@ const Dropdown = ({
4881
4886
  }
4882
4887
  }, [isDisabled]);
4883
4888
  const childrenArray = external_react_default().Children.toArray(children).filter(Boolean);
4889
+
4890
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4884
4891
  const items = childrenArray.map((child, index) => {
4885
4892
  options.push(child.props);
4886
4893
  return /*#__PURE__*/external_react_default().cloneElement(child, {
@@ -5233,7 +5240,9 @@ const Indicator = ({
5233
5240
  background: background,
5234
5241
  children: text
5235
5242
  }) : null, /*#__PURE__*/external_react_default().cloneElement(children, {
5236
- ref: ref => childrenRef.current = ref
5243
+ ref: ref => {
5244
+ childrenRef.current = ref;
5245
+ }
5237
5246
  })]
5238
5247
  });
5239
5248
  };
@@ -5852,6 +5861,8 @@ const MultipleDropdownOptions = ({
5852
5861
  }
5853
5862
  };
5854
5863
  const childrenArray = external_react_default().Children.toArray(children).filter(Boolean);
5864
+
5865
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5855
5866
  const options = childrenArray.map(child => {
5856
5867
  const element = allItems[child.props.value];
5857
5868
  const isActive = Boolean(element?.isSelected);
@@ -6822,6 +6833,38 @@ const getRoundedNumber = (number, roundingDigits) => Number(Number(number).toFix
6822
6833
  const getFixedNumber = (number, roundingDigits) => Number(number).toFixed(roundingDigits);
6823
6834
  ;// ./src/components/Charts/PieChart/constants.ts
6824
6835
  const TOOLTIP_HEIGHT = 30;
6836
+ ;// ./src/components/Charts/utils/nivoReact19Compat.tsx
6837
+
6838
+
6839
+ /**
6840
+ * React 19 compatibility wrapper for Nivo responsive components.
6841
+ *
6842
+ * @nivo/core's ResponsiveWrapper returns an object in React 19, which causes
6843
+ * type checking issues. This utility wraps any Nivo responsive component
6844
+ * with forwardRef to ensure it's recognized as a proper React component.
6845
+ *
6846
+ * @param Component - The Nivo responsive component to wrap (e.g., ResponsiveLine, ResponsivePie)
6847
+ * @param displayName - The display name for the wrapped component
6848
+ * @returns A React 19 compatible version of the component
6849
+ */
6850
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6851
+ function wrapNivoResponsiveComponent(Component, displayName) {
6852
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6853
+ const WrappedComponent = /*#__PURE__*/external_react_default().forwardRef((props, ref) => {
6854
+ // Force React.createElement to handle the component, even if it's an object
6855
+ // This works around React 19's stricter type checking
6856
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6857
+ return /*#__PURE__*/external_react_default().createElement(Component, {
6858
+ ...props,
6859
+ ref
6860
+ });
6861
+ });
6862
+ WrappedComponent.displayName = displayName;
6863
+
6864
+ // Type assertion needed for React 19 compatibility
6865
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6866
+ return WrappedComponent;
6867
+ }
6825
6868
  ;// ./src/components/Charts/PieChart/PieChartInternal.tsx
6826
6869
  function PieChartInternal_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
6827
6870
 
@@ -6837,6 +6880,8 @@ function PieChartInternal_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tr
6837
6880
 
6838
6881
 
6839
6882
 
6883
+
6884
+ const ResponsivePie = wrapNivoResponsiveComponent(pie_namespaceObject.ResponsivePie, 'ResponsivePie');
6840
6885
  var PieChartInternal_ref = true ? {
6841
6886
  name: "1jvc3zp",
6842
6887
  styles: "width:95%!important;height:95%!important;top:2.5%!important;left:2.5%!important"
@@ -6965,7 +7010,7 @@ const PieChartInternal = ({
6965
7010
  className: "pie-chart-wrapper",
6966
7011
  ref: refs.setReference,
6967
7012
  ...getReferenceProps(),
6968
- children: [(0,jsx_runtime_namespaceObject.jsx)(pie_namespaceObject.ResponsivePie, {
7013
+ children: [(0,jsx_runtime_namespaceObject.jsx)(ResponsivePie, {
6969
7014
  margin: {
6970
7015
  top: internalOffset,
6971
7016
  right: internalOffset,
@@ -8226,7 +8271,8 @@ const useTooltip = props => {
8226
8271
  size = 'small',
8227
8272
  hasArrow = true,
8228
8273
  arrowProps = {},
8229
- isOpen: isInitOpen = false
8274
+ isOpen: isInitOpen = false,
8275
+ allowHoverContent = false
8230
8276
  } = props || {};
8231
8277
  const [isOpen, setIsOpen] = (0,external_react_namespaceObject.useState)(isInitOpen || false);
8232
8278
  const arrowRef = (0,external_react_namespaceObject.useRef)(null);
@@ -8244,7 +8290,8 @@ const useTooltip = props => {
8244
8290
  } = floatingData;
8245
8291
  const hover = (0,external_floating_ui_react_namespaceObject.useHover)(context, {
8246
8292
  enabled: enableHover,
8247
- move: true
8293
+ move: true,
8294
+ handleClose: allowHoverContent ? (0,external_floating_ui_react_namespaceObject.safePolygon)() : undefined
8248
8295
  });
8249
8296
  const click = (0,external_floating_ui_react_namespaceObject.useClick)(context, {
8250
8297
  enabled: enableClick
@@ -10306,6 +10353,8 @@ function TreeMapChart_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried
10306
10353
 
10307
10354
 
10308
10355
 
10356
+
10357
+ const ResponsiveTreeMap = wrapNivoResponsiveComponent(treemap_namespaceObject.ResponsiveTreeMap, 'ResponsiveTreeMap');
10309
10358
  var TreeMapChart_ref = true ? {
10310
10359
  name: "1qkt16r",
10311
10360
  styles: "position:relative;height:100%;width:100%"
@@ -10336,7 +10385,7 @@ const TreeMapChartComponent = ({
10336
10385
  css: TreeMapChart_ref,
10337
10386
  children: (0,jsx_runtime_namespaceObject.jsx)("div", {
10338
10387
  css: TreeMapChart_ref2,
10339
- children: (0,jsx_runtime_namespaceObject.jsx)(treemap_namespaceObject.ResponsiveTreeMap, {
10388
+ children: (0,jsx_runtime_namespaceObject.jsx)(ResponsiveTreeMap, {
10340
10389
  borderWidth: 0,
10341
10390
  colors: colors,
10342
10391
  data: data,
@@ -10437,11 +10486,13 @@ const GaugeChartLayer = /*#__PURE__*/base_default()("div", true ? {
10437
10486
 
10438
10487
 
10439
10488
 
10489
+
10490
+ const GaugeChartBase_ResponsivePie = wrapNivoResponsiveComponent(pie_namespaceObject.ResponsivePie, 'ResponsivePie');
10440
10491
  const GaugeChartBase = ({
10441
10492
  ...props
10442
10493
  }) => {
10443
10494
  const theme = (0,react_namespaceObject.useTheme)();
10444
- return (0,jsx_runtime_namespaceObject.jsx)(pie_namespaceObject.ResponsivePie, {
10495
+ return (0,jsx_runtime_namespaceObject.jsx)(GaugeChartBase_ResponsivePie, {
10445
10496
  startAngle: -90,
10446
10497
  endAngle: 90,
10447
10498
  innerRadius: 0.8,
@@ -11033,7 +11084,7 @@ const line_namespaceObject = require("@nivo/line");
11033
11084
 
11034
11085
  const TrendLineTooltipStyled = /*#__PURE__*/base_default()("div", true ? {
11035
11086
  target: "e19yhkwp0"
11036
- } : 0)("background:", ({
11087
+ } : 0)("white-space:nowrap;background:", ({
11037
11088
  theme
11038
11089
  }) => theme.colors.white, ";border:1px solid ", ({
11039
11090
  theme
@@ -11042,6 +11093,7 @@ const TrendLineTooltipStyled = /*#__PURE__*/base_default()("div", true ? {
11042
11093
  }) => theme.colors.greyDarker, ";font-weight:600;line-height:12px;font-size:10px;padding:0.5rem;" + ( true ? "" : 0));
11043
11094
  const TrendLineTooltip = ({
11044
11095
  point,
11096
+ css,
11045
11097
  valueFormat
11046
11098
  }) => {
11047
11099
  const {
@@ -11052,6 +11104,7 @@ const TrendLineTooltip = ({
11052
11104
  yFormatted
11053
11105
  } = point.data;
11054
11106
  return (0,jsx_runtime_namespaceObject.jsx)(TrendLineTooltipStyled, {
11107
+ css: css,
11055
11108
  children: valueFormat?.(data) ?? `${xFormatted} - ${yFormatted}`
11056
11109
  });
11057
11110
  };
@@ -11061,6 +11114,8 @@ const TrendLineTooltip = ({
11061
11114
 
11062
11115
 
11063
11116
 
11117
+
11118
+ const ResponsiveLine = wrapNivoResponsiveComponent(line_namespaceObject.ResponsiveLine, 'ResponsiveLine');
11064
11119
  const ActivePoint = ({
11065
11120
  currentPoint,
11066
11121
  lastActivePoint,
@@ -11090,7 +11145,7 @@ const TrendLine = ({
11090
11145
  }) => {
11091
11146
  const theme = (0,react_namespaceObject.useTheme)();
11092
11147
  const _color = color ?? theme.colors.purpleDark;
11093
- return (0,jsx_runtime_namespaceObject.jsx)(line_namespaceObject.ResponsiveLine, {
11148
+ return (0,jsx_runtime_namespaceObject.jsx)(ResponsiveLine, {
11094
11149
  axisBottom: null,
11095
11150
  axisLeft: null,
11096
11151
  axisRight: null,
@@ -11165,12 +11220,8 @@ var BigNumberChart_ref2 = true ? {
11165
11220
  styles: "font-size:32px;font-weight:700"
11166
11221
  } : 0;
11167
11222
  var BigNumberChart_ref3 = true ? {
11168
- name: "26qidl",
11169
- styles: "position:relative;width:100%;height:50%"
11170
- } : 0;
11171
- var BigNumberChart_ref4 = true ? {
11172
- name: "19s8nj4",
11173
- styles: "position:absolute;width:100%;height:100%"
11223
+ name: "195w1i9",
11224
+ styles: "position:relative;width:100%;height:50%;min-height:100px"
11174
11225
  } : 0;
11175
11226
  const BigNumberChartComponent = ({
11176
11227
  data,
@@ -11182,6 +11233,11 @@ const BigNumberChartComponent = ({
11182
11233
  valueFormat
11183
11234
  }) => {
11184
11235
  const [hoveredValue, setHoveredValue] = (0,external_react_namespaceObject.useState)(null);
11236
+ const {
11237
+ ref: chartContainerRef,
11238
+ width,
11239
+ height
11240
+ } = (0,hooks_namespaceObject.useElementSize)();
11185
11241
  const lastValue = data.sort((a, b) => {
11186
11242
  const ax = a.x ?? 0;
11187
11243
  const bx = b.x ?? 0;
@@ -11190,9 +11246,11 @@ const BigNumberChartComponent = ({
11190
11246
  const setHoveredValueThrottled = (0,hooks_namespaceObject.useThrottledCallback)(value => {
11191
11247
  setHoveredValue(value);
11192
11248
  }, 100);
11193
- const handleMouseMove = data => {
11249
+ const handleMouseMove = datum => {
11194
11250
  if (!interactive) return;
11195
- setHoveredValueThrottled(data.data);
11251
+ if ('data' in datum) {
11252
+ setHoveredValueThrottled(datum.data);
11253
+ }
11196
11254
  };
11197
11255
  const value = hoveredValue ?? lastValue;
11198
11256
  return (0,jsx_runtime_namespaceObject.jsx)(WithWidgetCard, {
@@ -11214,18 +11272,18 @@ const BigNumberChartComponent = ({
11214
11272
  children: value && (valueFormat?.(value) ?? value?.y?.toString())
11215
11273
  })
11216
11274
  }), (0,jsx_runtime_namespaceObject.jsx)("div", {
11275
+ ref: chartContainerRef,
11217
11276
  css: BigNumberChart_ref3,
11218
- children: (0,jsx_runtime_namespaceObject.jsx)("div", {
11219
- css: BigNumberChart_ref4,
11220
- children: (0,jsx_runtime_namespaceObject.jsx)(TrendLine, {
11221
- ...trendLineProps,
11222
- data: [{
11223
- id: 'trend-line',
11224
- data
11225
- }],
11226
- onMouseMove: handleMouseMove,
11227
- lastActivePoint: value
11228
- })
11277
+ children: width > 0 && height > 0 && (0,jsx_runtime_namespaceObject.jsx)(TrendLine, {
11278
+ ...trendLineProps,
11279
+ data: [{
11280
+ id: 'trend-line',
11281
+ data
11282
+ }],
11283
+ onMouseMove: handleMouseMove,
11284
+ lastActivePoint: value,
11285
+ height: height,
11286
+ width: width
11229
11287
  })
11230
11288
  })]
11231
11289
  })
@@ -11481,6 +11539,7 @@ const CandlestickChart = WithFullscreenMode(CandlestickChartComponent);
11481
11539
 
11482
11540
 
11483
11541
 
11542
+
11484
11543
  ;// ./src/components/Checkbox/index.ts
11485
11544
 
11486
11545
 
@@ -11908,10 +11967,12 @@ const PopoverTrigger = /*#__PURE__*/external_react_namespaceObject.forwardRef(fu
11908
11967
 
11909
11968
  // `asChild` allows the user to pass any element as the anchor
11910
11969
  if (asChild && /*#__PURE__*/external_react_namespaceObject.isValidElement(children)) {
11970
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11971
+ const childrenElement = children;
11911
11972
  return /*#__PURE__*/external_react_namespaceObject.cloneElement(children, context?.getReferenceProps({
11912
11973
  ref,
11913
11974
  ...props,
11914
- ...children.props,
11975
+ ...childrenElement.props,
11915
11976
  'data-state': context.open ? 'open' : 'closed'
11916
11977
  }));
11917
11978
  }
@@ -12156,14 +12217,15 @@ const TriggerIcon = ({
12156
12217
  iconName,
12157
12218
  iconSize,
12158
12219
  className,
12159
- CustomIcon
12220
+ CustomIcon,
12221
+ css: cssProp
12160
12222
  }) => {
12161
12223
  const theme = (0,react_namespaceObject.useTheme)();
12162
12224
  const {
12163
12225
  showIconTooltip
12164
12226
  } = useCollapsibleNavBarContext();
12165
12227
  return (0,jsx_runtime_namespaceObject.jsx)(Wrapper_Wrapper, {
12166
- css: TriggerIcon_ref,
12228
+ css: [TriggerIcon_ref, cssProp, true ? "" : 0, true ? "" : 0],
12167
12229
  className: "trigger-icon",
12168
12230
  children: CustomIcon ? (0,jsx_runtime_namespaceObject.jsx)(CustomIcon, {
12169
12231
  size: iconSize,
@@ -12191,7 +12253,6 @@ const TriggerIcon = ({
12191
12253
 
12192
12254
 
12193
12255
 
12194
-
12195
12256
  const ItemAccordionTitle_Link = CollapsibleNavBarLink.withComponent('div', true ? {
12196
12257
  target: "e69hc760"
12197
12258
  } : 0);
@@ -12227,9 +12288,7 @@ const ItemAccordionTitle = ({
12227
12288
  const Icon = () => (0,jsx_runtime_namespaceObject.jsx)(TriggerIcon, {
12228
12289
  iconName: item.iconName,
12229
12290
  iconSize: item.iconSize,
12230
- css: /*#__PURE__*/(0,react_namespaceObject.css)({
12231
- ...item.css
12232
- }, true ? "" : 0, true ? "" : 0)
12291
+ css: item.css
12233
12292
  });
12234
12293
  return (0,jsx_runtime_namespaceObject.jsx)(CollapsibleNavBarItemProvider, {
12235
12294
  isActive: isActive,
@@ -12353,7 +12412,6 @@ const Item = ({
12353
12412
 
12354
12413
 
12355
12414
 
12356
-
12357
12415
  const ItemWithoutSubMenu_Item = ({
12358
12416
  item,
12359
12417
  onClick
@@ -12395,9 +12453,7 @@ const ItemWithoutSubMenu_Item = ({
12395
12453
  iconName: iconName,
12396
12454
  iconSize: iconSize,
12397
12455
  CustomIcon: CustomIcon,
12398
- css: /*#__PURE__*/(0,react_namespaceObject.css)({
12399
- ...css
12400
- }, true ? "" : 0, true ? "" : 0)
12456
+ css: css
12401
12457
  });
12402
12458
  return (0,jsx_runtime_namespaceObject.jsx)(CollapsibleNavBarItemProvider, {
12403
12459
  isActive: isActive,
@@ -14350,54 +14406,72 @@ function PersonInfo_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have t
14350
14406
 
14351
14407
 
14352
14408
  const PersonInfoBase = /*#__PURE__*/base_default()("div", true ? {
14353
- target: "ej2kihb12"
14409
+ target: "ej2kihb15"
14354
14410
  } : 0)( true ? {
14355
14411
  name: "3w0yoi",
14356
14412
  styles: "display:flex;flex-direction:column;gap:8px"
14357
14413
  } : 0);
14358
14414
  const PersonInfoHeader = /*#__PURE__*/base_default()("div", true ? {
14359
- target: "ej2kihb11"
14415
+ target: "ej2kihb14"
14360
14416
  } : 0)( true ? {
14361
14417
  name: "1ocjxm6",
14362
14418
  styles: "display:flex;align-items:flex-start;gap:8px"
14363
14419
  } : 0);
14364
14420
  const styles_IconWrapper = /*#__PURE__*/base_default()("div", true ? {
14365
- target: "ej2kihb10"
14421
+ target: "ej2kihb13"
14366
14422
  } : 0)( true ? {
14367
14423
  name: "13ltyg2",
14368
14424
  styles: "display:flex;align-items:flex-start;flex-shrink:0"
14369
14425
  } : 0);
14370
14426
  const styles_TitleWrapper = /*#__PURE__*/base_default()("div", true ? {
14371
- target: "ej2kihb9"
14427
+ target: "ej2kihb12"
14372
14428
  } : 0)( true ? {
14373
14429
  name: "1tcizyl",
14374
14430
  styles: "display:flex;flex-direction:column;gap:4px;flex:1"
14375
14431
  } : 0);
14376
14432
  const Title = /*#__PURE__*/base_default()("div", true ? {
14377
- target: "ej2kihb8"
14433
+ target: "ej2kihb11"
14378
14434
  } : 0)( true ? {
14379
14435
  name: "edklr6",
14380
14436
  styles: "font-size:14px;font-weight:600;line-height:19px"
14381
14437
  } : 0);
14438
+ const Row = /*#__PURE__*/base_default()("div", true ? {
14439
+ target: "ej2kihb10"
14440
+ } : 0)( true ? {
14441
+ name: "1j5vobt",
14442
+ styles: "display:flex;align-items:center;gap:4px"
14443
+ } : 0);
14382
14444
  const TextBase = /*#__PURE__*/base_default()("div", true ? {
14383
- target: "ej2kihb7"
14445
+ target: "ej2kihb9"
14384
14446
  } : 0)( true ? {
14385
14447
  name: "1bzpq77",
14386
14448
  styles: "font-size:14px;font-weight:400;line-height:19px"
14387
14449
  } : 0);
14388
14450
  const ValueWithCounter = /*#__PURE__*/base_default()("div", true ? {
14389
- target: "ej2kihb6"
14451
+ target: "ej2kihb8"
14390
14452
  } : 0)( true ? {
14391
14453
  name: "1j5vobt",
14392
14454
  styles: "display:flex;align-items:center;gap:4px"
14393
14455
  } : 0);
14394
14456
  const Counter = /*#__PURE__*/base_default()(TextBase.withComponent('span', true ? {
14395
- target: "ej2kihb13"
14457
+ target: "ej2kihb16"
14396
14458
  } : 0), true ? {
14397
- target: "ej2kihb5"
14459
+ target: "ej2kihb7"
14398
14460
  } : 0)("color:", ({
14399
14461
  theme
14400
- }) => theme.colors.greyDropdownFocused, ";margin-left:5px;" + ( true ? "" : 0));
14462
+ }) => theme.colors.greyDropdownFocused, ";margin-left:5px;cursor:pointer;" + ( true ? "" : 0));
14463
+ const CounterTooltipContent = /*#__PURE__*/base_default()("div", true ? {
14464
+ target: "ej2kihb6"
14465
+ } : 0)( true ? {
14466
+ name: "1oeds5o",
14467
+ styles: "min-width:220px;padding:12px"
14468
+ } : 0);
14469
+ const CounterTooltipList = /*#__PURE__*/base_default()("div", true ? {
14470
+ target: "ej2kihb5"
14471
+ } : 0)( true ? {
14472
+ name: "1acx518",
14473
+ styles: "display:flex;flex-direction:column;gap:8px;height:auto;max-height:220px;overflow:hidden;overflow-y:auto;padding-right:4px"
14474
+ } : 0);
14401
14475
  const AttributesList = /*#__PURE__*/base_default()("div", true ? {
14402
14476
  target: "ej2kihb4"
14403
14477
  } : 0)( true ? {
@@ -14441,6 +14515,29 @@ const CustomBadge = /*#__PURE__*/base_default()("div", true ? {
14441
14515
  } = BADGE_COLORS(theme)[colorName];
14442
14516
  return bg;
14443
14517
  }, ";" + ( true ? "" : 0));
14518
+ const personInfoValueLinkStyles = theme => ({
14519
+ textDecoration: 'none',
14520
+ color: theme.colors.greyDarker,
14521
+ cursor: 'pointer',
14522
+ transition: 'color 0.2s ease',
14523
+ display: 'inline-flex',
14524
+ alignItems: 'center',
14525
+ '&:hover': {
14526
+ color: theme.colors.blue
14527
+ }
14528
+ });
14529
+ const avatarWrapperLinkStyles = theme => ({
14530
+ textDecoration: 'none',
14531
+ color: theme.colors.greyDarker,
14532
+ cursor: 'pointer',
14533
+ transition: 'color 0.2s ease',
14534
+ '&:hover': {
14535
+ color: theme.colors.blue,
14536
+ '& > div:last-child': {
14537
+ color: theme.colors.blue
14538
+ }
14539
+ }
14540
+ });
14444
14541
  ;// ./src/components/PersonInfo/PersonInfoIcon.tsx
14445
14542
 
14446
14543
 
@@ -14465,17 +14562,25 @@ const PersonInfoIcon = ({
14465
14562
 
14466
14563
  const PersonInfoValue = ({
14467
14564
  value,
14468
- counter,
14469
14565
  css,
14470
- counterCss
14566
+ linkAttributes
14471
14567
  }) => {
14472
- return (0,jsx_runtime_namespaceObject.jsxs)(TextBase, {
14473
- css: css,
14474
- children: [value, counter && (0,jsx_runtime_namespaceObject.jsxs)(Counter, {
14475
- css: counterCss,
14476
- children: [" ", counter]
14477
- })]
14478
- });
14568
+ const isLink = Boolean(linkAttributes?.href);
14569
+ return (0,jsx_runtime_namespaceObject.jsx)(TextBase, {
14570
+ css: [isLink ? personInfoValueLinkStyles : undefined, css, true ? "" : 0, true ? "" : 0],
14571
+ ...(linkAttributes ?? {}),
14572
+ children: value
14573
+ });
14574
+ };
14575
+ ;// ./src/components/PersonInfo/helpers.ts
14576
+ const getLinkAttributes = (link, openLinkInNewTab) => {
14577
+ const isLink = Boolean(link);
14578
+ return isLink ? {
14579
+ as: 'a',
14580
+ href: link,
14581
+ target: openLinkInNewTab ? '_blank' : undefined,
14582
+ rel: openLinkInNewTab ? 'noreferrer' : undefined
14583
+ } : {};
14479
14584
  };
14480
14585
  ;// ./src/components/PersonInfo/PersonInfoAvatar.tsx
14481
14586
 
@@ -14483,22 +14588,34 @@ const PersonInfoValue = ({
14483
14588
 
14484
14589
 
14485
14590
 
14591
+
14486
14592
  const PersonInfoAvatar = ({
14487
14593
  avatar,
14488
14594
  value,
14489
- counter,
14490
- styles
14595
+ styles,
14596
+ link,
14597
+ openLinkInNewTab
14491
14598
  }) => {
14599
+ const hasAvatar = Boolean(avatar);
14600
+ const hasValue = Boolean(value);
14601
+ const isLink = Boolean(link);
14602
+ const linkAttributes = getLinkAttributes(link, openLinkInNewTab);
14603
+ if (!hasAvatar && !hasValue) return null;
14604
+ const valueNode = hasValue ? (0,jsx_runtime_namespaceObject.jsx)(PersonInfoValue, {
14605
+ value: value,
14606
+ css: hasAvatar ? styles?.avatarName : styles?.value,
14607
+ linkAttributes: !hasAvatar ? linkAttributes : undefined
14608
+ }) : null;
14609
+ if (!hasAvatar) {
14610
+ return valueNode;
14611
+ }
14492
14612
  return (0,jsx_runtime_namespaceObject.jsxs)(styles_AvatarWrapper, {
14613
+ css: isLink ? avatarWrapperLinkStyles : undefined,
14614
+ ...linkAttributes,
14493
14615
  children: [(0,jsx_runtime_namespaceObject.jsx)(Avatar_Avatar, {
14494
14616
  size: 24,
14495
14617
  image: avatar
14496
- }), value && (0,jsx_runtime_namespaceObject.jsx)(PersonInfoValue, {
14497
- value: value,
14498
- counter: counter,
14499
- css: styles?.avatarName,
14500
- counterCss: styles?.counter
14501
- })]
14618
+ }), valueNode]
14502
14619
  });
14503
14620
  };
14504
14621
  ;// ./src/components/PersonInfo/PersonInfoBadges.tsx
@@ -14535,6 +14652,100 @@ const PersonInfoBadges = ({
14535
14652
  })
14536
14653
  });
14537
14654
  };
14655
+ ;// ./src/components/ImageItem/ImageItem.tsx
14656
+ function ImageItem_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
14657
+
14658
+
14659
+
14660
+
14661
+ var ImageItem_ref = true ? {
14662
+ name: "c5ejfv",
14663
+ styles: "gap:8px;text-decoration:none"
14664
+ } : 0;
14665
+ const ImageItem = ({
14666
+ children,
14667
+ image,
14668
+ avatarSize = 24,
14669
+ link = '',
14670
+ openLinkInNewTab = false,
14671
+ className
14672
+ }) => {
14673
+ const theme = (0,react_namespaceObject.useTheme)();
14674
+ const additionalProps = link ? {
14675
+ href: link,
14676
+ target: openLinkInNewTab ? '_blank' : undefined
14677
+ } : {};
14678
+ return (0,jsx_runtime_namespaceObject.jsxs)(Wrapper_Wrapper, {
14679
+ css: ImageItem_ref,
14680
+ as: link ? 'a' : 'div',
14681
+ className: className,
14682
+ "data-testid": "image-item",
14683
+ ...additionalProps,
14684
+ children: [(0,jsx_runtime_namespaceObject.jsx)(Avatar_Avatar, {
14685
+ size: avatarSize,
14686
+ image: image
14687
+ }), (0,jsx_runtime_namespaceObject.jsx)("span", {
14688
+ css: /*#__PURE__*/(0,react_namespaceObject.css)({
14689
+ color: theme.colors.greyDarker,
14690
+ fontSize: 14,
14691
+ fontWeight: 500,
14692
+ cursor: link ? 'pointer' : 'default',
14693
+ '&:hover': {
14694
+ color: link ? theme.colors.blue : theme.colors.greyDarker
14695
+ }
14696
+ }, true ? "" : 0, true ? "" : 0),
14697
+ children: children
14698
+ })]
14699
+ });
14700
+ };
14701
+ ;// ./src/components/PersonInfo/PersonInfoCounter.tsx
14702
+
14703
+
14704
+
14705
+
14706
+
14707
+
14708
+
14709
+ const PersonInfoCounter = ({
14710
+ counterTooltip,
14711
+ css
14712
+ }) => {
14713
+ const tooltipUsers = counterTooltip?.users ?? [];
14714
+ const hasTooltipUsers = tooltipUsers.length > 0;
14715
+ const counterValue = hasTooltipUsers ? `+${tooltipUsers.length}` : null;
14716
+ if (!counterValue) {
14717
+ return null;
14718
+ }
14719
+ const tooltipBody = (0,jsx_runtime_namespaceObject.jsx)(CounterTooltipList, {
14720
+ "data-testid": "person-info-counter-tooltip-list",
14721
+ children: tooltipUsers.map(user => (0,jsx_runtime_namespaceObject.jsx)(ImageItem, {
14722
+ image: user.avatar,
14723
+ link: user.link,
14724
+ openLinkInNewTab: user.openLinkInNewTab,
14725
+ children: user.name
14726
+ }, user.id))
14727
+ });
14728
+ const counterNode = (0,jsx_runtime_namespaceObject.jsx)(Counter, {
14729
+ css: css,
14730
+ "data-testid": "person-info-counter",
14731
+ children: counterValue
14732
+ });
14733
+ return (0,jsx_runtime_namespaceObject.jsxs)(Tooltip_Tooltip, {
14734
+ enableHover: true,
14735
+ enableClick: false,
14736
+ allowHoverContent: true,
14737
+ placement: "top",
14738
+ size: "medium",
14739
+ hasArrow: true,
14740
+ children: [(0,jsx_runtime_namespaceObject.jsx)(TooltipTrigger_TooltipTrigger, {
14741
+ children: counterNode
14742
+ }), (0,jsx_runtime_namespaceObject.jsx)(TooltipContent_TooltipContent, {
14743
+ children: (0,jsx_runtime_namespaceObject.jsx)(CounterTooltipContent, {
14744
+ children: tooltipBody
14745
+ })
14746
+ })]
14747
+ });
14748
+ };
14538
14749
  ;// ./src/components/PersonInfo/PersonInfo.tsx
14539
14750
 
14540
14751
 
@@ -14549,11 +14760,13 @@ const PersonInfo = /*#__PURE__*/external_react_default().forwardRef(function Per
14549
14760
  value,
14550
14761
  badges,
14551
14762
  avatar,
14552
- counter,
14763
+ counterTooltip,
14553
14764
  attributes,
14554
14765
  description,
14555
14766
  styles,
14556
14767
  className,
14768
+ link,
14769
+ openLinkInNewTab,
14557
14770
  ...props
14558
14771
  }, ref) {
14559
14772
  return (0,jsx_runtime_namespaceObject.jsx)(PersonInfoBase, {
@@ -14567,16 +14780,17 @@ const PersonInfo = /*#__PURE__*/external_react_default().forwardRef(function Per
14567
14780
  children: [(0,jsx_runtime_namespaceObject.jsx)(Title, {
14568
14781
  css: styles?.title,
14569
14782
  children: title
14570
- }), avatar && (0,jsx_runtime_namespaceObject.jsx)(PersonInfoAvatar, {
14571
- avatar: avatar,
14572
- value: value,
14573
- counter: counter,
14574
- styles: styles
14575
- }), !avatar && value && (0,jsx_runtime_namespaceObject.jsx)(PersonInfoValue, {
14576
- value: value,
14577
- counter: counter,
14578
- css: styles?.value,
14579
- counterCss: styles?.counter
14783
+ }), (0,jsx_runtime_namespaceObject.jsxs)(Row, {
14784
+ children: [(0,jsx_runtime_namespaceObject.jsx)(PersonInfoAvatar, {
14785
+ avatar: avatar,
14786
+ value: value,
14787
+ styles: styles,
14788
+ link: link,
14789
+ openLinkInNewTab: openLinkInNewTab
14790
+ }), counterTooltip && (0,jsx_runtime_namespaceObject.jsx)(PersonInfoCounter, {
14791
+ counterTooltip: counterTooltip,
14792
+ css: styles?.counter
14793
+ })]
14580
14794
  }), badges && (0,jsx_runtime_namespaceObject.jsx)(PersonInfoBadges, {
14581
14795
  badges: badges,
14582
14796
  styles: styles
@@ -14814,8 +15028,8 @@ const styles_MonthsViewCell = /*#__PURE__*/base_default()("div", true ? {
14814
15028
  const TriggerWrapper = /*#__PURE__*/base_default()(Wrapper_Wrapper, true ? {
14815
15029
  target: "e19l41fq0"
14816
15030
  } : 0)( true ? {
14817
- name: "1utaypi",
14818
- styles: "padding:14px"
15031
+ name: "1h91tay",
15032
+ styles: "padding:14px;cursor:default"
14819
15033
  } : 0);
14820
15034
  ;// ./src/components/DateRangePicker/utils/dates.ts
14821
15035
 
@@ -14907,7 +15121,6 @@ const DateRangePickerContext = /*#__PURE__*/(0,external_react_namespaceObject.cr
14907
15121
  nameFrom: '',
14908
15122
  nameTo: '',
14909
15123
  maskOptions: {},
14910
- openCalendarMode: 'icon',
14911
15124
  inputFromRef: {
14912
15125
  current: null
14913
15126
  },
@@ -14936,9 +15149,6 @@ const DateRangePickerContext = /*#__PURE__*/(0,external_react_namespaceObject.cr
14936
15149
  day: 1
14937
15150
  }),
14938
15151
  currentIndex: 0,
14939
- handleSetIsOpen: () => {
14940
- // no-op
14941
- },
14942
15152
  handleToggleOpen: () => {
14943
15153
  // no-op
14944
15154
  },
@@ -14948,6 +15158,13 @@ const DateRangePickerContext = /*#__PURE__*/(0,external_react_namespaceObject.cr
14948
15158
  setCalendarType: () => {
14949
15159
  // no-op
14950
15160
  },
15161
+ rangeSelectionStep: null,
15162
+ setRangeSelectionStep: () => {
15163
+ // no-op
15164
+ },
15165
+ clearInputValue: () => {
15166
+ // no-op
15167
+ },
14951
15168
  setCalendarViewDateTime: () => {
14952
15169
  // no-op
14953
15170
  },
@@ -14956,7 +15173,8 @@ const DateRangePickerContext = /*#__PURE__*/(0,external_react_namespaceObject.cr
14956
15173
  },
14957
15174
  setLastFocusedElement: () => {
14958
15175
  // no-op
14959
- }
15176
+ },
15177
+ allowReverseSelection: false
14960
15178
  });
14961
15179
  ;// ./src/components/DateRangePicker/useDateRangePickerContext.tsx
14962
15180
 
@@ -15014,6 +15232,88 @@ const useRangeHighlighting = () => {
15014
15232
  hoveredDate
15015
15233
  };
15016
15234
  };
15235
+ ;// ./src/components/DateRangePicker/hooks/useRangeSelection.ts
15236
+
15237
+ const useRangeSelection = ({
15238
+ createNewDate,
15239
+ getComparisonFormat
15240
+ }) => {
15241
+ const {
15242
+ dateTime,
15243
+ calendarViewDateTime,
15244
+ setCalendarViewDateTime,
15245
+ setDateTime,
15246
+ setIsOpen,
15247
+ setLastFocusedElement,
15248
+ rangeSelectionStep,
15249
+ setRangeSelectionStep,
15250
+ clearInputValue,
15251
+ allowReverseSelection = false,
15252
+ onChange
15253
+ } = useDateRangePickerContext();
15254
+ const handleRangeSelect = selectedValue => {
15255
+ const newDate = createNewDate(selectedValue);
15256
+ if (!newDate) return;
15257
+
15258
+ // Range selection logic
15259
+ const isSelectingStart = rangeSelectionStep === 'start';
15260
+ if (isSelectingStart) {
15261
+ clearInputValue('to');
15262
+ setLastFocusedElement('to');
15263
+ setRangeSelectionStep('end');
15264
+ }
15265
+ let newDateTuple = isSelectingStart ? [newDate, undefined] : [dateTime[0], newDate];
15266
+ setCalendarViewDateTime(isSelectingStart ? [newDate, newDate] : [dateTime[0] ? calendarViewDateTime?.[0] : newDate, newDate]);
15267
+
15268
+ // Check if dates are in reverse order
15269
+ const isReversed = newDateTuple[0] && newDateTuple[1] && newDateTuple[0].toMillis() > newDateTuple[1].toMillis();
15270
+ if (isReversed) {
15271
+ if (allowReverseSelection) {
15272
+ // Auto-swap dates when reverse selection is allowed
15273
+ newDateTuple = [newDateTuple[1], newDateTuple[0]];
15274
+ } else if (!isSelectingStart) {
15275
+ // User selected an earlier date - update start date
15276
+ newDateTuple = [newDateTuple[1], undefined];
15277
+ setLastFocusedElement('to');
15278
+ setRangeSelectionStep('end');
15279
+ setCalendarViewDateTime([newDateTuple[0], newDateTuple[0]]);
15280
+ }
15281
+ }
15282
+ setDateTime(newDateTuple);
15283
+ const normalizeToMidnight = dt => dt.set({
15284
+ hour: 0,
15285
+ minute: 0,
15286
+ second: 0,
15287
+ millisecond: 0
15288
+ }).toJSDate();
15289
+
15290
+ // Call onChange when a date is selected from calendar
15291
+ if (isSelectingStart && newDateTuple[0]) {
15292
+ // First date selected
15293
+ onChange?.([normalizeToMidnight(newDateTuple[0]), null]);
15294
+ } else if (newDateTuple[0] && newDateTuple[1] && newDateTuple[0].toMillis() <= newDateTuple[1].toMillis()) {
15295
+ // Both dates selected and in correct order
15296
+ onChange?.([normalizeToMidnight(newDateTuple[0]), normalizeToMidnight(newDateTuple[1])]);
15297
+ setRangeSelectionStep(null);
15298
+ setIsOpen(false);
15299
+ }
15300
+ };
15301
+ const getDateSelectionState = currentDT => {
15302
+ const comparisonFormat = getComparisonFormat();
15303
+ const isCalendarFirstDateSelected = currentDT.toFormat(comparisonFormat) === dateTime[0]?.toFormat(comparisonFormat);
15304
+ const isCalendarSecondDateSelected = currentDT.toFormat(comparisonFormat) === dateTime[1]?.toFormat(comparisonFormat);
15305
+ const isCalendarDateSelected = isCalendarFirstDateSelected || isCalendarSecondDateSelected;
15306
+ return {
15307
+ isCalendarFirstDateSelected,
15308
+ isCalendarSecondDateSelected,
15309
+ isCalendarDateSelected
15310
+ };
15311
+ };
15312
+ return {
15313
+ handleRangeSelect,
15314
+ getDateSelectionState
15315
+ };
15316
+ };
15017
15317
  ;// ./src/components/DateRangePicker/components/DaysView.tsx
15018
15318
  function components_DaysView_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
15019
15319
 
@@ -15040,15 +15340,9 @@ var components_DaysView_ref3 = true ? {
15040
15340
  const DaysView_DaysView = () => {
15041
15341
  const weekDays = dates_getWeekDays();
15042
15342
  const {
15043
- dateTime,
15044
- calendarViewDateTime,
15045
15343
  dateMinDT,
15046
15344
  dateMaxDT,
15047
- lastFocusedElement,
15048
- currentCalendarViewDT,
15049
- setCalendarViewDateTime,
15050
- setDateTime,
15051
- setIsOpen
15345
+ currentCalendarViewDT
15052
15346
  } = useDateRangePickerContext();
15053
15347
  const currentDate = currentCalendarViewDT.toJSDate();
15054
15348
  const currentMonth = currentDate?.getMonth();
@@ -15059,22 +15353,23 @@ const DaysView_DaysView = () => {
15059
15353
  getClassNames,
15060
15354
  isHighlightDate
15061
15355
  } = useRangeHighlighting();
15356
+ const {
15357
+ handleRangeSelect,
15358
+ getDateSelectionState
15359
+ } = useRangeSelection({
15360
+ createNewDate: selectedDay => currentCalendarViewDT.set({
15361
+ day: Number(selectedDay)
15362
+ }),
15363
+ getComparisonFormat: () => 'D'
15364
+ });
15062
15365
  const handleDaySelect = event => {
15063
15366
  const {
15064
15367
  target
15065
15368
  } = event;
15066
- const selectedDay = Number(target.innerHTML);
15369
+ const selectedDay = target.innerHTML;
15067
15370
  const isEnabled = target.getAttribute('aria-disabled') === 'false';
15068
15371
  if (isEnabled) {
15069
- const newDate = currentCalendarViewDT.set({
15070
- day: selectedDay
15071
- });
15072
- const newDateTuple = lastFocusedElement === 'from' ? [newDate, dateTime[1]] : [dateTime[0], newDate];
15073
- setCalendarViewDateTime(lastFocusedElement === 'from' ? [newDate, dateTime[1] ? calendarViewDateTime?.[1] : newDate] : [dateTime[0] ? calendarViewDateTime?.[0] : newDate, newDate]);
15074
- setDateTime(newDateTuple);
15075
- if (newDateTuple[0] && newDateTuple[1]) {
15076
- setIsOpen(false);
15077
- }
15372
+ handleRangeSelect(selectedDay);
15078
15373
  }
15079
15374
  };
15080
15375
  return (0,jsx_runtime_namespaceObject.jsxs)((external_react_default()).Fragment, {
@@ -15088,16 +15383,18 @@ const DaysView_DaysView = () => {
15088
15383
  css: components_DaysView_ref3,
15089
15384
  onClick: handleDaySelect,
15090
15385
  children: dates.map((currentDate, index) => {
15091
- const currentDT = external_luxon_namespaceObject.DateTime.fromJSDate(currentDate);
15386
+ const currentDT = external_luxon_namespaceObject.DateTime.fromJSDate(currentDate).startOf('day');
15092
15387
  const calendarDate = currentDT.toFormat('D');
15093
15388
  const calendarDay = currentDate.getDate();
15094
15389
  const calendarMonth = currentDate.getMonth();
15095
15390
  const ariaLabel = currentDT.toLocaleString(external_luxon_namespaceObject.DateTime.DATE_HUGE);
15096
15391
  const isCalendarDateNow = nowDate === calendarDate;
15097
15392
  const isCalendarMonth = currentMonth === calendarMonth;
15098
- const isCalendarFirstDateSelected = calendarDate === dateTime[0]?.toFormat('D');
15099
- const isCalendarSecondDateSelected = calendarDate === dateTime[1]?.toFormat('D');
15100
- const isCalendarDateSelected = isCalendarFirstDateSelected || isCalendarSecondDateSelected;
15393
+ const {
15394
+ isCalendarFirstDateSelected,
15395
+ isCalendarSecondDateSelected,
15396
+ isCalendarDateSelected
15397
+ } = getDateSelectionState(currentDT);
15101
15398
  let isAriaDisabled = false;
15102
15399
  if (dateMinDT && dateMaxDT) {
15103
15400
  isAriaDisabled = currentDT < dateMinDT || currentDT > dateMaxDT || !isCalendarMonth;
@@ -15146,24 +15443,36 @@ var components_MonthsView_ref = true ? {
15146
15443
  } : 0;
15147
15444
  const MonthsView_MonthsView = () => {
15148
15445
  const {
15149
- dateTime,
15150
- calendarViewDateTime,
15151
15446
  dateMinDT,
15152
15447
  dateMaxDT,
15153
15448
  lastFocusedElement,
15154
15449
  currentCalendarViewDT,
15450
+ calendarViewDateTime,
15155
15451
  rangePickerType,
15156
15452
  setCalendarType,
15157
15453
  setCalendarViewDateTime,
15158
- onMonthChange,
15159
- setDateTime,
15160
- setIsOpen
15454
+ onMonthChange
15161
15455
  } = useDateRangePickerContext();
15162
15456
  const {
15163
15457
  handleDateHover,
15164
15458
  getClassNames,
15165
15459
  isHighlightDate
15166
15460
  } = useRangeHighlighting();
15461
+ const {
15462
+ handleRangeSelect,
15463
+ getDateSelectionState
15464
+ } = useRangeSelection({
15465
+ createNewDate: selectedMonth => {
15466
+ const monthNumber = constants_MONTHS.findIndex(month => month === selectedMonth);
15467
+ const newMonth = currentCalendarViewDT?.set({
15468
+ month: monthNumber + 1
15469
+ });
15470
+ return newMonth?.set({
15471
+ day: lastFocusedElement === 'from' ? 1 : newMonth.daysInMonth
15472
+ });
15473
+ },
15474
+ getComparisonFormat: () => 'yyyy-MM'
15475
+ });
15167
15476
  const handleMonthSelect = event => {
15168
15477
  const {
15169
15478
  target
@@ -15174,29 +15483,20 @@ const MonthsView_MonthsView = () => {
15174
15483
  return;
15175
15484
  }
15176
15485
  const selectedMonth = target.innerHTML;
15177
- const monthNumber = constants_MONTHS.findIndex(month => month === selectedMonth);
15178
15486
  if (rangePickerType === 'days') {
15487
+ // Navigation case: selecting month navigates to days view
15488
+ const monthNumber = constants_MONTHS.findIndex(month => month === selectedMonth);
15179
15489
  const newDate = currentCalendarViewDT?.set({
15180
15490
  month: monthNumber + 1
15181
15491
  });
15182
- setCalendarViewDateTime(lastFocusedElement === 'from' ? [newDate, calendarViewDateTime[1]] : [calendarViewDateTime[0], newDate]);
15183
15492
  if (newDate) {
15493
+ setCalendarViewDateTime(lastFocusedElement === 'from' ? [newDate, calendarViewDateTime[1]] : [calendarViewDateTime[0], newDate]);
15184
15494
  onMonthChange?.(newDate.toJSDate());
15495
+ setCalendarType('days');
15185
15496
  }
15186
- setCalendarType('days');
15187
15497
  } else {
15188
- const newMonth = currentCalendarViewDT?.set({
15189
- month: monthNumber + 1
15190
- });
15191
- const newDate = newMonth?.set({
15192
- day: lastFocusedElement === 'from' ? 1 : newMonth.daysInMonth
15193
- });
15194
- const newDateTuple = lastFocusedElement === 'from' ? [newDate, dateTime[1]] : [dateTime[0], newDate];
15195
- setCalendarViewDateTime(lastFocusedElement === 'from' ? [newDate, dateTime[1] ? calendarViewDateTime?.[1] : newDate] : [dateTime[0] ? calendarViewDateTime?.[0] : newDate, newDate]);
15196
- setDateTime(newDateTuple);
15197
- if (newDateTuple[0] && newDateTuple[1]) {
15198
- setIsOpen(false);
15199
- }
15498
+ // Range selection case: selecting month completes the range
15499
+ handleRangeSelect(selectedMonth);
15200
15500
  }
15201
15501
  };
15202
15502
  return (0,jsx_runtime_namespaceObject.jsx)(DatesListWrapper, {
@@ -15211,8 +15511,10 @@ const MonthsView_MonthsView = () => {
15211
15511
  const isMinMonthReached = dateMinDT ? currentMonthDT.month < dateMinDT.month && currentMonthDT.year === dateMinDT.year : false;
15212
15512
  const isMaxMonthReached = dateMaxDT ? currentMonthDT.month > dateMaxDT.month && currentMonthDT.year === dateMaxDT.year : false;
15213
15513
  const isAriaDisabled = isMinMonthReached || isMaxMonthReached;
15214
- const isCalendarFirstDateSelected = currentMonthDT.toFormat('yyyy-MM') === dateTime[0]?.toFormat('yyyy-MM');
15215
- const isCalendarSecondDateSelected = currentMonthDT.toFormat('yyyy-MM') === dateTime[1]?.toFormat('yyyy-MM');
15514
+ const {
15515
+ isCalendarFirstDateSelected,
15516
+ isCalendarSecondDateSelected
15517
+ } = getDateSelectionState(currentMonthDT);
15216
15518
  const classNames = getClassNames(currentMonthDT, {
15217
15519
  isCalendarFirstDateSelected,
15218
15520
  isCalendarSecondDateSelected
@@ -15248,7 +15550,6 @@ var components_YearsView_ref = true ? {
15248
15550
  const YearsView_YearsView = () => {
15249
15551
  const {
15250
15552
  rangePickerType,
15251
- dateTime,
15252
15553
  calendarViewDateTime,
15253
15554
  currentCalendarViewDT,
15254
15555
  dateMinParts,
@@ -15257,9 +15558,7 @@ const YearsView_YearsView = () => {
15257
15558
  lastFocusedElement,
15258
15559
  setCalendarType,
15259
15560
  setCalendarViewDateTime,
15260
- onYearChange,
15261
- setDateTime,
15262
- setIsOpen
15561
+ onYearChange
15263
15562
  } = useDateRangePickerContext();
15264
15563
  const wrapper = (0,external_react_namespaceObject.useRef)(null);
15265
15564
  const yearsList = dates_getYearsList({
@@ -15271,6 +15570,24 @@ const YearsView_YearsView = () => {
15271
15570
  getClassNames,
15272
15571
  isHighlightDate
15273
15572
  } = useRangeHighlighting();
15573
+ const {
15574
+ handleRangeSelect,
15575
+ getDateSelectionState
15576
+ } = useRangeSelection({
15577
+ createNewDate: selectedYear => {
15578
+ const newYear = currentCalendarViewDT?.set({
15579
+ year: Number(selectedYear)
15580
+ });
15581
+ return newYear?.set(lastFocusedElement === 'from' ? {
15582
+ day: 1,
15583
+ month: 1
15584
+ } : {
15585
+ day: 31,
15586
+ month: 12
15587
+ });
15588
+ },
15589
+ getComparisonFormat: () => 'yyyy'
15590
+ });
15274
15591
  (0,external_react_namespaceObject.useEffect)(() => {
15275
15592
  if (currentCalendarViewDT && wrapper.current) {
15276
15593
  wrapper.current.querySelector('[aria-current=date]')?.scrollIntoView({
@@ -15278,15 +15595,16 @@ const YearsView_YearsView = () => {
15278
15595
  block: 'center'
15279
15596
  });
15280
15597
  }
15281
- }, [calendarViewDateTime, lastFocusedElement]);
15598
+ }, [calendarViewDateTime, lastFocusedElement, currentCalendarViewDT]);
15282
15599
  const handleYearSelect = event => {
15283
15600
  const {
15284
15601
  target
15285
15602
  } = event;
15286
- const selectedYear = Number(target.innerHTML);
15603
+ const selectedYear = target.innerHTML;
15287
15604
  if (rangePickerType !== 'years') {
15605
+ // Navigation case: selecting year navigates to months view
15288
15606
  const newDate = currentCalendarViewDT.set({
15289
- year: selectedYear
15607
+ year: Number(selectedYear)
15290
15608
  });
15291
15609
  setCalendarType('months');
15292
15610
  setCalendarViewDateTime(lastFocusedElement === 'from' ? [newDate, calendarViewDateTime[1]] : [calendarViewDateTime[0], newDate]);
@@ -15294,22 +15612,8 @@ const YearsView_YearsView = () => {
15294
15612
  onYearChange?.(newDate.toJSDate());
15295
15613
  }
15296
15614
  } else {
15297
- const newYear = currentCalendarViewDT?.set({
15298
- year: selectedYear
15299
- });
15300
- const newDate = newYear?.set(lastFocusedElement === 'from' ? {
15301
- day: 1,
15302
- month: 1
15303
- } : {
15304
- day: 31,
15305
- month: 12
15306
- });
15307
- const newDateTuple = lastFocusedElement === 'from' ? [newDate, dateTime[1]] : [dateTime[0], newDate];
15308
- setCalendarViewDateTime(lastFocusedElement === 'from' ? [newDate, dateTime[1] ? calendarViewDateTime?.[1] : newDate] : [dateTime[0] ? calendarViewDateTime?.[0] : newDate, newDate]);
15309
- setDateTime(newDateTuple);
15310
- if (newDateTuple[0] && newDateTuple[1]) {
15311
- setIsOpen(false);
15312
- }
15615
+ // Range selection case: selecting year completes the range
15616
+ handleRangeSelect(selectedYear);
15313
15617
  }
15314
15618
  };
15315
15619
  return (0,jsx_runtime_namespaceObject.jsx)(DatesListWrapper, {
@@ -15327,8 +15631,10 @@ const YearsView_YearsView = () => {
15327
15631
  if (isCalendarYear) {
15328
15632
  additionalProps['aria-current'] = 'date';
15329
15633
  }
15330
- const isCalendarFirstDateSelected = year.toString() === dateTime[0]?.toFormat('yyyy');
15331
- const isCalendarSecondDateSelected = year.toString() === dateTime[1]?.toFormat('yyyy');
15634
+ const {
15635
+ isCalendarFirstDateSelected,
15636
+ isCalendarSecondDateSelected
15637
+ } = getDateSelectionState(currentYearDT);
15332
15638
  const classNames = getClassNames(currentYearDT, {
15333
15639
  isCalendarFirstDateSelected,
15334
15640
  isCalendarSecondDateSelected
@@ -15668,24 +15974,9 @@ function TriggerInput_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried
15668
15974
 
15669
15975
 
15670
15976
 
15671
- const WithTriggerPopover = ({
15672
- isEnabled,
15673
- children
15674
- }) => {
15675
- return isEnabled ? (0,jsx_runtime_namespaceObject.jsx)(PopoverTrigger, {
15676
- asChild: true,
15677
- children: /*#__PURE__*/external_react_default().cloneElement(children, {
15678
- ...children.props
15679
- })
15680
- }) : (/*#__PURE__*/external_react_default().cloneElement(children, {
15681
- ...children.props
15682
- }));
15683
- };
15684
15977
  const TriggerInput = ({
15685
15978
  datepickerType,
15686
- withPopover = false,
15687
- className,
15688
- onClick
15979
+ className
15689
15980
  }) => {
15690
15981
  const {
15691
15982
  format,
@@ -15698,7 +15989,9 @@ const TriggerInput = ({
15698
15989
  messages,
15699
15990
  setLastFocusedElement,
15700
15991
  classNames,
15701
- onBlur: handleBlur
15992
+ onBlur: handleBlur,
15993
+ isOpen,
15994
+ setIsOpen
15702
15995
  } = useDateRangePickerContext();
15703
15996
  const formContext = (0,external_react_hook_form_namespaceObject.useFormContext)(); // Using FormProvider from react-hook-form
15704
15997
  const useFormResult = (0,external_react_hook_form_namespaceObject.useForm)();
@@ -15720,42 +16013,55 @@ const TriggerInput = ({
15720
16013
  setLastFocusedElement(datepickerType);
15721
16014
  inputProps?.inputProps?.onFocus?.(e);
15722
16015
  };
15723
- const handleOpen = event => {
15724
- onClick?.(event);
15725
- };
15726
- return (0,jsx_runtime_namespaceObject.jsx)(WithTriggerPopover, {
15727
- isEnabled: withPopover,
15728
- children: (0,jsx_runtime_namespaceObject.jsx)(Input_Input, {
15729
- name: currentName,
15730
- placeholder: format,
15731
- ref: datepickerType === 'from' ? inputFromRef : inputToRef,
15732
- disabled: disabled,
15733
- register: register,
15734
- className: className,
15735
- wrapperClassName: /*#__PURE__*/(0,css_namespaceObject.css)("display:flex;padding-left:", datepickerType === 'from' ? 0 : 14, "px;" + ( true ? "" : 0), true ? "" : 0),
15736
- inputProps: {
15737
- onBlur: handleBlur,
15738
- onClick: handleOpen,
15739
- onFocus: handleFocus,
15740
- id: inputProps?.inputProps?.id || currentName,
15741
- 'data-testid': `daterangepicker-input-${datepickerType}`,
15742
- autoComplete: 'off',
15743
- className: [/*#__PURE__*/(0,css_namespaceObject.css)( true ? {
15744
- name: "15obm9d",
15745
- styles: "border:none!important;height:auto!important;padding:0!important;min-width:75px;line-height:16px;max-height:16px;letter-spacing:0.8px;border-radius:0!important;&::placeholder{letter-spacing:normal;}"
15746
- } : 0), datepickerType === 'from' ? classNames?.trigger?.inputFrom : classNames?.trigger?.inputTo].filter(Boolean).join(' '),
15747
- ...inputElementProps
16016
+ return (0,jsx_runtime_namespaceObject.jsx)(Input_Input, {
16017
+ name: currentName,
16018
+ placeholder: format,
16019
+ ref: datepickerType === 'from' ? inputFromRef : inputToRef,
16020
+ disabled: disabled,
16021
+ register: register,
16022
+ className: className,
16023
+ wrapperClassName: /*#__PURE__*/(0,css_namespaceObject.css)("display:flex;padding-left:", datepickerType === 'from' ? 0 : 14, "px;" + ( true ? "" : 0), true ? "" : 0),
16024
+ inputProps: {
16025
+ onBlur: handleBlur,
16026
+ onFocus: handleFocus,
16027
+ onClick: e => {
16028
+ if (isOpen) {
16029
+ setIsOpen(false);
16030
+ }
16031
+ inputProps?.inputProps?.onClick?.(e);
15748
16032
  },
15749
- showStatusIcon: false,
15750
- errors: fieldError,
15751
- status: fieldStatus,
15752
- helperText: fieldStatus === 'basic' ? messages?.description : messages?.error,
15753
- helperClassName: /*#__PURE__*/(0,css_namespaceObject.css)( true ? {
15754
- name: "lhoo11",
15755
- styles: "&>span::first-letter{text-transform:uppercase;}"
15756
- } : 0),
15757
- ...restInputProps
15758
- })
16033
+ onKeyDown: e => {
16034
+ inputProps?.inputProps?.onKeyDown?.(e);
16035
+ },
16036
+ onBeforeInput: e => {
16037
+ // pass-through
16038
+ inputProps?.inputProps?.onBeforeInput?.(e);
16039
+ },
16040
+ onInput: e => {
16041
+ // pass-through
16042
+ inputProps?.inputProps?.onInput?.(e);
16043
+ },
16044
+ onChange: e => {
16045
+ inputProps?.inputProps?.onChange?.(e);
16046
+ },
16047
+ id: inputProps?.inputProps?.id || currentName,
16048
+ 'data-testid': `daterangepicker-input-${datepickerType}`,
16049
+ autoComplete: 'off',
16050
+ className: [/*#__PURE__*/(0,css_namespaceObject.css)( true ? {
16051
+ name: "15obm9d",
16052
+ styles: "border:none!important;height:auto!important;padding:0!important;min-width:75px;line-height:16px;max-height:16px;letter-spacing:0.8px;border-radius:0!important;&::placeholder{letter-spacing:normal;}"
16053
+ } : 0), datepickerType === 'from' ? classNames?.trigger?.inputFrom : classNames?.trigger?.inputTo].filter(Boolean).join(' '),
16054
+ ...inputElementProps
16055
+ },
16056
+ showStatusIcon: false,
16057
+ errors: fieldError,
16058
+ status: fieldStatus,
16059
+ helperText: fieldStatus === 'basic' ? messages?.description : messages?.error,
16060
+ helperClassName: /*#__PURE__*/(0,css_namespaceObject.css)( true ? {
16061
+ name: "lhoo11",
16062
+ styles: "&>span::first-letter{text-transform:uppercase;}"
16063
+ } : 0),
16064
+ ...restInputProps
15759
16065
  });
15760
16066
  };
15761
16067
  ;// ./src/components/Field/FieldDescription.tsx
@@ -15855,8 +16161,8 @@ function Trigger_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to st
15855
16161
 
15856
16162
 
15857
16163
  var Trigger_ref = true ? {
15858
- name: "1ldd2k6",
15859
- styles: "margin:0 3px"
16164
+ name: "cx8u11",
16165
+ styles: "margin:0 3px;cursor:pointer"
15860
16166
  } : 0;
15861
16167
  const Trigger = () => {
15862
16168
  const {
@@ -15866,7 +16172,6 @@ const Trigger = () => {
15866
16172
  lastFocusedElement,
15867
16173
  disabled,
15868
16174
  status,
15869
- openCalendarMode,
15870
16175
  isOpen,
15871
16176
  showCalendarIcon,
15872
16177
  showStatusArea,
@@ -15899,49 +16204,46 @@ const Trigger = () => {
15899
16204
  ref: wrapperRef,
15900
16205
  className: classNames?.trigger?.controlsWrapper,
15901
16206
  children: [(0,jsx_runtime_namespaceObject.jsx)(TriggerInput, {
15902
- withPopover: true,
15903
16207
  datepickerType: "from",
15904
- className: classNames?.trigger?.inputFrom,
15905
- onClick: () => {
15906
- if (!isOpen) {
15907
- setIsOpen(true);
15908
- }
15909
- }
16208
+ className: classNames?.trigger?.inputFrom
15910
16209
  }), (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
15911
16210
  name: "carrot-right",
15912
16211
  size: 16,
15913
16212
  color: disabled ? theme.colors.grey : theme.colors.greyDarker,
15914
16213
  className: classNames?.trigger?.arrowIcon,
16214
+ onClick: () => {
16215
+ if (isOpen) {
16216
+ setIsOpen(false);
16217
+ }
16218
+ },
15915
16219
  css: Trigger_ref
15916
16220
  }), (0,jsx_runtime_namespaceObject.jsx)(TriggerInput, {
15917
16221
  datepickerType: "to",
15918
- className: classNames?.trigger?.inputTo,
15919
- onClick: () => {
15920
- if (!isOpen) {
15921
- setIsOpen(true);
15922
- }
15923
- }
15924
- }), showCalendarIcon && (0,jsx_runtime_namespaceObject.jsx)(Button_Button, {
15925
- endIcon: (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
15926
- name: "calendar",
15927
- size: 16,
15928
- color: disabled ? theme.colors.grey : theme.colors.greyDarker
15929
- }),
15930
- "data-testid": 'daterangepicker-button',
15931
- onClick: handleToggleOpen,
15932
- variant: "tertiary",
15933
- "aria-label": "Calendar",
15934
- isDisabled: disabled,
15935
- className: classNames?.trigger?.calendarIcon,
15936
- css: /*#__PURE__*/(0,react_namespaceObject.css)({
15937
- padding: 0,
15938
- margin: '0 0 0 10px',
15939
- height: 'auto',
15940
- cursor: openCalendarMode === 'input' || disabled ? 'default' : 'pointer',
15941
- '&:focus::before': {
15942
- display: 'none'
15943
- }
15944
- }, true ? "" : 0, true ? "" : 0)
16222
+ className: classNames?.trigger?.inputTo
16223
+ }), showCalendarIcon && (0,jsx_runtime_namespaceObject.jsx)(PopoverTrigger, {
16224
+ asChild: true,
16225
+ children: (0,jsx_runtime_namespaceObject.jsx)(Button_Button, {
16226
+ endIcon: (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
16227
+ name: "calendar",
16228
+ size: 16,
16229
+ color: disabled ? theme.colors.grey : theme.colors.greyDarker
16230
+ }),
16231
+ "data-testid": 'daterangepicker-button',
16232
+ onClick: handleToggleOpen,
16233
+ variant: "tertiary",
16234
+ "aria-label": "Calendar",
16235
+ isDisabled: disabled,
16236
+ className: classNames?.trigger?.calendarIcon,
16237
+ css: /*#__PURE__*/(0,react_namespaceObject.css)({
16238
+ padding: 0,
16239
+ margin: '0 0 0 10px',
16240
+ height: 'auto',
16241
+ cursor: disabled ? 'default' : 'pointer',
16242
+ '&:focus::before': {
16243
+ display: 'none'
16244
+ }
16245
+ }, true ? "" : 0, true ? "" : 0)
16246
+ })
15945
16247
  })]
15946
16248
  })
15947
16249
  }), showStatusArea && (0,jsx_runtime_namespaceObject.jsx)(TriggerStatusArea, {})]
@@ -15966,12 +16268,8 @@ const Content_DatePickerContent = () => {
15966
16268
  };
15967
16269
  ;// ./src/components/DateRangePicker/hooks/useDatePickerMask.tsx
15968
16270
 
15969
-
15970
16271
  const useDatePickerMask_useDatePickerMask = ({
15971
- maskOptions,
15972
- formatIndexes,
15973
- dateMinParts,
15974
- dateMaxParts
16272
+ maskOptions
15975
16273
  }) => {
15976
16274
  const {
15977
16275
  mask,
@@ -15984,28 +16282,13 @@ const useDatePickerMask_useDatePickerMask = ({
15984
16282
  mask,
15985
16283
  replacement,
15986
16284
  track: ({
15987
- data,
15988
- selectionStart,
15989
- selectionEnd,
15990
- value: currentValue
16285
+ data
15991
16286
  }) => {
15992
- const isDateMask = typeof mask === 'string' && /^[_/]+$/.test(mask);
15993
- if (isDateMask) {
15994
- const newValue = currentValue.slice(0, selectionStart) + data + currentValue.slice(selectionEnd);
15995
- const updatedValue = (0,mask_namespaceObject.format)(newValue, {
15996
- mask,
15997
- replacement
15998
- });
15999
- const splittedValue = updatedValue.split('/');
16000
- const isChecked = dates_processDate({
16001
- day: splittedValue[formatIndexes['day']],
16002
- month: splittedValue[formatIndexes['month']],
16003
- year: splittedValue[formatIndexes['year']]
16004
- }, dateMinParts[formatIndexes['year']], dateMaxParts[formatIndexes['year']]);
16005
- return isChecked ? data : '';
16006
- } else {
16007
- return data;
16008
- }
16287
+ // The mask should only format input, not validate it
16288
+ // Validation happens on blur in useDateRangePicker.handleBlur
16289
+ // This allows users to freely type and edit dates without blocking
16290
+ // Return data as-is (string for insertions, null/undefined for deletions)
16291
+ return data;
16009
16292
  },
16010
16293
  ...restMaskOptions
16011
16294
  });
@@ -16047,15 +16330,12 @@ const useDateRangePicker = ({
16047
16330
  const [isOpen, setIsOpen] = (0,external_react_namespaceObject.useState)(isOpenState);
16048
16331
  const [status, setStatus] = (0,external_react_namespaceObject.useState)(rest.status);
16049
16332
  const previousOpenState = (0,external_react_namespaceObject.useRef)(isOpenState);
16050
- const handleSetIsOpen = open => {
16051
- setIsOpen(open);
16052
- };
16333
+ const previousDateTime = (0,external_react_namespaceObject.useRef)([undefined, undefined]);
16334
+ const defaultValueProcessed = (0,external_react_namespaceObject.useRef)(false);
16053
16335
  const {
16054
16336
  clearErrors,
16055
16337
  setError,
16056
- setValue,
16057
- resetField,
16058
- setFocus
16338
+ setValue
16059
16339
  } = (0,external_react_hook_form_namespaceObject.useFormContext)();
16060
16340
  const nameFrom = `${_name}From`;
16061
16341
  const nameTo = `${_name}To`;
@@ -16069,7 +16349,6 @@ const useDateRangePicker = ({
16069
16349
  const [lastChangedDate, setLastChangedDate] = (0,external_react_namespaceObject.useState)([undefined, undefined]);
16070
16350
  const [lastFocusedElement, setLastFocusedElement] = (0,external_react_namespaceObject.useState)('from');
16071
16351
  const currentIndex = lastFocusedElement === 'from' ? 0 : 1;
16072
- const currentName = lastFocusedElement === 'from' ? nameFrom : nameTo;
16073
16352
  const [dateTimeForChangeEvent, setDateTimeForChangeEvent] = (0,external_react_namespaceObject.useState)(undefined);
16074
16353
  const [currentError, setCurrentError] = (0,external_react_namespaceObject.useState)({
16075
16354
  date: null,
@@ -16082,6 +16361,7 @@ const useDateRangePicker = ({
16082
16361
  year: splittedFormat.findIndex(item => item === 'yyyy')
16083
16362
  });
16084
16363
  const [calendarType, setCalendarType] = (0,external_react_namespaceObject.useState)(rangePickerType);
16364
+ const [rangeSelectionStep, setRangeSelectionStep] = (0,external_react_namespaceObject.useState)(null);
16085
16365
  const [calendarViewDateTime, setCalendarViewDateTime] = (0,external_react_namespaceObject.useState)([undefined, undefined]);
16086
16366
  const currentCalendarViewDT = calendarViewDateTime[currentIndex] || external_luxon_namespaceObject.DateTime.now().set({
16087
16367
  day: 1
@@ -16091,14 +16371,18 @@ const useDateRangePicker = ({
16091
16371
  const dateMinParts = finalDateMin.split('/').map(Number);
16092
16372
  const dateMaxParts = finalDateMax.split('/').map(Number);
16093
16373
  const defaultMask = getMaskForFormat(format);
16094
- const maskInputRef = useDatePickerMask_useDatePickerMask({
16374
+ // separate mask refs per input to prevent focus/typing conflicts
16375
+ const maskInputRefFrom = useDatePickerMask_useDatePickerMask({
16095
16376
  maskOptions: {
16096
16377
  mask: defaultMask,
16097
- ...maskOptions
16098
- },
16099
- dateMaxParts,
16100
- dateMinParts,
16101
- formatIndexes
16378
+ ...(maskOptions || {})
16379
+ }
16380
+ });
16381
+ const maskInputRefTo = useDatePickerMask_useDatePickerMask({
16382
+ maskOptions: {
16383
+ mask: defaultMask,
16384
+ ...(maskOptions || {})
16385
+ }
16102
16386
  });
16103
16387
  const dateMaxDT = external_luxon_namespaceObject.DateTime.fromObject({
16104
16388
  year: dateMaxParts[formatIndexes['year']],
@@ -16152,7 +16436,7 @@ const useDateRangePicker = ({
16152
16436
  setError(currentName, {
16153
16437
  message: errorMessage
16154
16438
  }, {
16155
- shouldFocus: true
16439
+ shouldFocus: false
16156
16440
  });
16157
16441
  setStatus('error');
16158
16442
  setDateTime(newDateTimeIfInvalid);
@@ -16164,7 +16448,7 @@ const useDateRangePicker = ({
16164
16448
  setError(currentName, {
16165
16449
  message: errorMessage
16166
16450
  }, {
16167
- shouldFocus: true
16451
+ shouldFocus: false
16168
16452
  });
16169
16453
  setStatus('error');
16170
16454
  setDateTime(newDateTimeIfInvalid);
@@ -16172,6 +16456,33 @@ const useDateRangePicker = ({
16172
16456
  safeOnChange();
16173
16457
  } else {
16174
16458
  setDateTime(newDateTimeIfValid);
16459
+ // Update calendar view to reflect the manually entered date
16460
+ let adjustedDateTime = newDateTime.startOf('day');
16461
+ if (adjustedDateTime < dateMinDT) {
16462
+ const {
16463
+ year,
16464
+ month,
16465
+ day
16466
+ } = dateMinDT;
16467
+ adjustedDateTime = adjustedDateTime.set({
16468
+ year,
16469
+ month,
16470
+ day
16471
+ });
16472
+ }
16473
+ if (adjustedDateTime > dateMaxDT) {
16474
+ const {
16475
+ year,
16476
+ month,
16477
+ day
16478
+ } = dateMaxDT;
16479
+ adjustedDateTime = adjustedDateTime.set({
16480
+ year,
16481
+ month,
16482
+ day
16483
+ });
16484
+ }
16485
+ setCalendarViewDateTime(currentElementType === 'from' ? [adjustedDateTime, calendarViewDateTime[1] || adjustedDateTime] : [calendarViewDateTime[0] || adjustedDateTime, adjustedDateTime]);
16175
16486
  clearErrors();
16176
16487
  setStatus('basic');
16177
16488
  safeOnError?.(null);
@@ -16180,26 +16491,35 @@ const useDateRangePicker = ({
16180
16491
  }
16181
16492
  };
16182
16493
  const handleBlur = event => {
16183
- event.preventDefault();
16184
16494
  const blurredValue = event.currentTarget.value;
16495
+ const fieldName = event.currentTarget.name;
16496
+ const isFromField = fieldName === nameFrom;
16185
16497
  if (blurredValue.length > 0) {
16186
- processValue(blurredValue);
16498
+ processValue(blurredValue, isFromField ? 'from' : 'to');
16499
+ } else {
16500
+ // User cleared the field - clear the corresponding dateTime
16501
+ setDateTime(prev => isFromField ? [undefined, prev[1]] : [prev[0], undefined]);
16502
+ setLastChangedDate(prev => isFromField ? [undefined, prev[1]] : [prev[0], undefined]);
16503
+ setValue(fieldName, undefined);
16504
+ clearErrors(fieldName);
16187
16505
  }
16188
16506
  };
16189
16507
  const processInputValue = (inputValue, elementName) => {
16190
16508
  const currentElementType = elementName || lastFocusedElement;
16191
16509
  const currentName = currentElementType === 'from' ? nameFrom : nameTo;
16510
+ const currentWatchedValue = currentElementType === 'from' ? inputValueFrom : inputValueTo;
16192
16511
  if (typeof inputValue === 'string' && inputValue.length && inputValue.length < expectedDateLength) {
16193
16512
  setIsOpen(false);
16194
- setTimeout(() => {
16195
- maskInputRef.current.focus();
16196
- }, 10);
16197
16513
  }
16198
16514
  let newDateTime;
16199
16515
  if (typeof inputValue === 'string' && inputValue.length === expectedDateLength) {
16200
16516
  newDateTime = external_luxon_namespaceObject.DateTime.fromFormat(inputValue, luxonFormat);
16201
- setValue(currentName, inputValue);
16202
- processValue(inputValue, elementName);
16517
+ // Avoid redundant setValue to prevent React Hook Form update loops
16518
+ if (currentWatchedValue !== inputValue) {
16519
+ setValue(currentName, inputValue);
16520
+ }
16521
+ // Do NOT validate immediately here to avoid blocking mid-edit scenarios and feedback loops.
16522
+ // Validation will happen on blur explicitly.
16203
16523
  }
16204
16524
  const newCalendarViewDateTime = newDateTime && newDateTime.isValid ? newDateTime : undefined;
16205
16525
  if (newCalendarViewDateTime) {
@@ -16247,56 +16567,95 @@ const useDateRangePicker = ({
16247
16567
  }
16248
16568
  }, [inputValueTo]);
16249
16569
  (0,external_react_namespaceObject.useEffect)(() => {
16250
- const currentIndex = lastFocusedElement === 'from' ? 0 : 1;
16251
- const currentInputValue = currentIndex === 0 ? inputValueFrom : inputValueTo;
16252
- if (dateTime?.[currentIndex]) {
16253
- const newValue = dateTime[currentIndex].toFormat(luxonFormat);
16254
- if (currentInputValue !== newValue) {
16255
- setValue(currentName, newValue);
16570
+ // Only sync when dateTime actually changes (from calendar selection or programmatic change)
16571
+ // Don't sync when only inputValue changes (user typing)
16572
+ const dateTimeChanged = previousDateTime.current[0]?.toMillis() !== dateTime[0]?.toMillis() || previousDateTime.current[1]?.toMillis() !== dateTime[1]?.toMillis();
16573
+
16574
+ // Initialize on first run
16575
+ if (previousDateTime.current[0] === undefined && previousDateTime.current[1] === undefined && (dateTime[0] !== undefined || dateTime[1] !== undefined)) {
16576
+ previousDateTime.current = [dateTime[0], dateTime[1]];
16577
+ // Continue to sync on initialization
16578
+ } else if (!dateTimeChanged) {
16579
+ // dateTime hasn't changed, don't sync (user is typing)
16580
+ return;
16581
+ } else {
16582
+ // Update previous dateTime
16583
+ previousDateTime.current = [dateTime[0], dateTime[1]];
16584
+ }
16585
+ const nextFromValue = dateTime[0]?.toFormat(luxonFormat);
16586
+ if (nextFromValue) {
16587
+ // Sync dateTime to form when dateTime changed (calendar selection)
16588
+ // Don't overwrite if user is actively typing (input is focused and partial)
16589
+ const isInputFocused = inputFromRef.current && document.activeElement === inputFromRef.current || inputToRef.current && document.activeElement === inputToRef.current;
16590
+ if (!inputValueFrom) {
16591
+ // Input is empty - sync from dateTime
16592
+ setValue(nameFrom, nextFromValue);
16593
+ } else if (inputValueFrom === nextFromValue) {
16594
+ // Already in sync - no action needed
16595
+ } else if (inputValueFrom.length < expectedDateLength && isInputFocused) {
16596
+ // User is actively typing partial input - don't overwrite
16597
+ } else {
16598
+ // dateTime changed (calendar selection) - sync to form
16599
+ setValue(nameFrom, nextFromValue);
16256
16600
  }
16257
16601
  }
16258
- }, [dateTime, lastFocusedElement, currentName]);
16602
+ const nextToValue = dateTime[1]?.toFormat(luxonFormat);
16603
+ if (nextToValue) {
16604
+ // Sync dateTime to form when dateTime changed (calendar selection)
16605
+ // Don't overwrite if user is actively typing (input is focused and partial)
16606
+ const isInputFocused = inputFromRef.current && document.activeElement === inputFromRef.current || inputToRef.current && document.activeElement === inputToRef.current;
16607
+ if (!inputValueTo) {
16608
+ // Input is empty - sync from dateTime
16609
+ setValue(nameTo, nextToValue);
16610
+ } else if (inputValueTo === nextToValue) {
16611
+ // Already in sync - no action needed
16612
+ } else if (inputValueTo.length < expectedDateLength && isInputFocused) {
16613
+ // User is actively typing partial input - don't overwrite
16614
+ } else {
16615
+ // dateTime changed (calendar selection) - sync to form
16616
+ setValue(nameTo, nextToValue);
16617
+ }
16618
+ }
16619
+ }, [dateTime, inputValueFrom, inputValueTo, luxonFormat, nameFrom, nameTo, setValue, expectedDateLength, inputFromRef, inputToRef]);
16259
16620
  (0,external_react_namespaceObject.useEffect)(() => {
16260
16621
  if (dateTime[0] && dateTime[1] && dateTime[0] > dateTime[1]) {
16622
+ // When dates are in reverse order, swap them silently
16623
+ // Calendar only opens via user click on icon button, not automatically
16261
16624
  if (lastFocusedElement === 'from') {
16262
- resetField(nameTo);
16263
16625
  setDateTime([dateTime[0], undefined]);
16264
16626
  setLastChangedDate([dateTime[0].toJSDate(), undefined]);
16265
16627
  setValue(nameTo, undefined);
16266
- setLastFocusedElement('to');
16267
- setTimeout(() => {
16268
- setFocus(nameTo, {
16269
- shouldSelect: true
16270
- });
16271
- }, 50);
16272
- setIsOpen(true);
16273
16628
  } else {
16274
- resetField(nameFrom);
16275
16629
  setDateTime([undefined, dateTime[1]]);
16276
16630
  setLastChangedDate([undefined, dateTime[1].toJSDate()]);
16277
16631
  setValue(nameFrom, undefined);
16278
- setLastFocusedElement('from');
16279
- setTimeout(() => {
16280
- setFocus(nameFrom, {
16281
- shouldSelect: true
16282
- });
16283
- }, 50);
16284
- setIsOpen(true);
16285
16632
  }
16286
16633
  }
16287
- }, [dateTime]);
16634
+ }, [dateTime, lastFocusedElement, nameFrom, nameTo, setValue]);
16288
16635
  (0,external_react_namespaceObject.useEffect)(() => {
16289
16636
  if (previousOpenState.current !== isOpen) {
16290
16637
  if (isOpen) {
16291
16638
  onOpen?.();
16639
+ setRangeSelectionStep('start');
16640
+ setLastFocusedElement('from');
16641
+ // Sync calendar view with current dateTime when opening
16642
+ // This ensures preselected dates are visible in the calendar
16643
+ if (dateTime[0] || dateTime[1]) {
16644
+ setCalendarViewDateTime([dateTime[0] || dateTime[1] || external_luxon_namespaceObject.DateTime.now().set({
16645
+ day: 1
16646
+ }), dateTime[1] || dateTime[0] || external_luxon_namespaceObject.DateTime.now().set({
16647
+ day: 1
16648
+ })]);
16649
+ }
16292
16650
  } else {
16293
16651
  onClose?.();
16652
+ setRangeSelectionStep(null);
16294
16653
  setCalendarType(rangePickerType);
16295
16654
  setCalendarViewDateTime([dateTime[0], dateTime[1]]);
16296
16655
  }
16297
16656
  previousOpenState.current = isOpen;
16298
16657
  }
16299
- }, [isOpen]);
16658
+ }, [isOpen, dateTime, rangePickerType, onOpen, onClose]);
16300
16659
  (0,external_react_namespaceObject.useEffect)(() => {
16301
16660
  const splittedFormat = format.split('/');
16302
16661
  setFormatIndexes({
@@ -16323,27 +16682,18 @@ const useDateRangePicker = ({
16323
16682
  if (Array.isArray(rest.value)) {
16324
16683
  const newDateTimeFrom = typeof rest.value[0] === 'string' && rest.value[0].length === expectedDateLength ? external_luxon_namespaceObject.DateTime.fromFormat(rest.value[0], luxonFormat) : undefined;
16325
16684
  const newDateTimeTo = typeof rest.value[1] === 'string' && rest.value[1].length === expectedDateLength ? external_luxon_namespaceObject.DateTime.fromFormat(rest.value[1], luxonFormat) : undefined;
16326
- const newDateTime = [newDateTimeFrom?.isValid ? newDateTimeFrom : undefined, newDateTimeTo?.isValid ? newDateTimeTo : undefined];
16685
+ const newDateTime = [newDateTimeFrom?.isValid ? newDateTimeFrom.startOf('day') : undefined, newDateTimeTo?.isValid ? newDateTimeTo.startOf('day') : undefined];
16327
16686
  setDateTime(newDateTime);
16328
16687
  setLastChangedDate([newDateTime[0]?.toJSDate(), newDateTime[1]?.toJSDate()]);
16688
+ // Sync calendar view with the new dates so they're visible when calendar opens
16689
+ setCalendarViewDateTime([newDateTime[0] || newDateTime[1] || undefined, newDateTime[1] || newDateTime[0] || undefined]);
16329
16690
  setValue(nameFrom, newDateTime[0]?.toFormat(luxonFormat));
16330
16691
  setValue(nameTo, newDateTime[1]?.toFormat(luxonFormat));
16331
16692
  }
16332
- }, [rest.value]);
16693
+ }, [rest.value, expectedDateLength, luxonFormat, nameFrom, nameTo, setValue, _name]);
16333
16694
  (0,external_react_namespaceObject.useEffect)(() => {
16334
16695
  setStatus(rest.status);
16335
16696
  }, [rest.status]);
16336
- (0,external_react_namespaceObject.useEffect)(() => {
16337
- if (lastChangedDate[0] || lastChangedDate[1]) {
16338
- if (lastFocusedElement === 'from' && !lastChangedDate[1]) {
16339
- setFocus(nameTo);
16340
- }
16341
- if (lastFocusedElement === 'to' && !lastChangedDate[0]) {
16342
- setFocus(nameFrom);
16343
- inputFromRef.current?.focus();
16344
- }
16345
- }
16346
- }, [lastChangedDate]);
16347
16697
  (0,external_react_namespaceObject.useEffect)(() => {
16348
16698
  if (calendarViewDateTime[0] && !calendarViewDateTime[1]) {
16349
16699
  setCalendarViewDateTime([calendarViewDateTime[0], calendarViewDateTime[0]]);
@@ -16358,11 +16708,20 @@ const useDateRangePicker = ({
16358
16708
  }
16359
16709
  }, [isOpenState]);
16360
16710
  (0,external_react_namespaceObject.useEffect)(() => {
16361
- if (defaultValue) {
16362
- setValue(nameFrom, defaultValue[0]);
16363
- setValue(nameTo, defaultValue[1]);
16711
+ // Only process defaultValue once on mount to avoid re-processing
16712
+ if (Array.isArray(defaultValue) && !defaultValueProcessed.current) {
16713
+ const defaultDateTimeFrom = typeof defaultValue[0] === 'string' && defaultValue[0].length === expectedDateLength ? external_luxon_namespaceObject.DateTime.fromFormat(defaultValue[0], luxonFormat) : undefined;
16714
+ const defaultDateTimeTo = typeof defaultValue[1] === 'string' && defaultValue[1].length === expectedDateLength ? external_luxon_namespaceObject.DateTime.fromFormat(defaultValue[1], luxonFormat) : undefined;
16715
+ const newDateTime = [defaultDateTimeFrom?.isValid ? defaultDateTimeFrom.startOf('day') : undefined, defaultDateTimeTo?.isValid ? defaultDateTimeTo.startOf('day') : undefined];
16716
+ setDateTime(newDateTime);
16717
+ setLastChangedDate([newDateTime[0]?.toJSDate(), newDateTime[1]?.toJSDate()]);
16718
+ // Sync calendar view with default dates so they're visible when calendar opens
16719
+ setCalendarViewDateTime([newDateTime[0] || newDateTime[1] || undefined, newDateTime[1] || newDateTime[0] || undefined]);
16720
+ setValue(nameFrom, newDateTime[0]?.toFormat(luxonFormat));
16721
+ setValue(nameTo, newDateTime[1]?.toFormat(luxonFormat));
16722
+ defaultValueProcessed.current = true;
16364
16723
  }
16365
- }, []);
16724
+ }, [defaultValue, expectedDateLength, luxonFormat, nameFrom, nameTo, setCalendarViewDateTime, setValue, _name]);
16366
16725
  return {
16367
16726
  formatIndexes,
16368
16727
  dateMinParts,
@@ -16373,7 +16732,6 @@ const useDateRangePicker = ({
16373
16732
  inputValueFrom,
16374
16733
  inputValueTo,
16375
16734
  calendarViewDateTime,
16376
- maskInputRef,
16377
16735
  calendarType,
16378
16736
  lastChangedDate,
16379
16737
  luxonFormat,
@@ -16384,16 +16742,24 @@ const useDateRangePicker = ({
16384
16742
  currentCalendarViewDT,
16385
16743
  isOpen,
16386
16744
  status,
16387
- inputFromRef: (0,external_floating_ui_react_namespaceObject.useMergeRefs)([maskInputRef, inputFromRef]),
16388
- inputToRef: (0,external_floating_ui_react_namespaceObject.useMergeRefs)([maskInputRef, inputToRef]),
16745
+ inputFromRef: (0,external_floating_ui_react_namespaceObject.useMergeRefs)([maskInputRefFrom, inputFromRef]),
16746
+ inputToRef: (0,external_floating_ui_react_namespaceObject.useMergeRefs)([maskInputRefTo, inputToRef]),
16389
16747
  setIsOpen,
16390
- handleSetIsOpen,
16391
16748
  setLastFocusedElement,
16392
16749
  safeOnChange,
16393
16750
  setCalendarType,
16394
16751
  setCalendarViewDateTime,
16395
16752
  setDateTime,
16396
- handleBlur
16753
+ handleBlur,
16754
+ rangeSelectionStep,
16755
+ setRangeSelectionStep,
16756
+ clearInputValue: field => {
16757
+ const targetName = field === 'from' ? nameFrom : nameTo;
16758
+ clearErrors(targetName);
16759
+ setValue(targetName, undefined);
16760
+ setDateTime(prev => field === 'from' ? [undefined, prev[1]] : [prev[0], undefined]);
16761
+ setLastChangedDate(prev => field === 'from' ? [undefined, prev[1]] : [prev[0], undefined]);
16762
+ }
16397
16763
  };
16398
16764
  };
16399
16765
  ;// ./src/components/DateRangePicker/DateRangePickerProvider.tsx
@@ -16422,7 +16788,7 @@ const DateRangePickerProvider = ({
16422
16788
  };
16423
16789
  const handleToggleOpen = e => {
16424
16790
  const tagName = e.currentTarget.tagName.toLowerCase();
16425
- if (rest.openCalendarMode === 'both' || rest.openCalendarMode === 'input' && tagName === 'input' || rest.openCalendarMode === 'icon' && tagName === 'button') {
16791
+ if (tagName === 'button') {
16426
16792
  toggleOpen();
16427
16793
  }
16428
16794
  if (tagName === 'input' && rest.inputProps?.inputProps?.onClick) {
@@ -16449,7 +16815,6 @@ const DateRangePickerProvider = ({
16449
16815
 
16450
16816
  const DateRangePicker = ({
16451
16817
  format,
16452
- openCalendarMode = 'icon',
16453
16818
  showCalendarIcon = true,
16454
16819
  showStatusArea = true,
16455
16820
  rangePickerType = 'days',
@@ -16458,7 +16823,6 @@ const DateRangePicker = ({
16458
16823
  const actualFormat = format || getFormatForRangePickerType(rangePickerType);
16459
16824
  return (0,jsx_runtime_namespaceObject.jsx)(DateRangePickerProvider, {
16460
16825
  format: actualFormat,
16461
- openCalendarMode: openCalendarMode,
16462
16826
  showCalendarIcon: showCalendarIcon,
16463
16827
  showStatusArea: showStatusArea,
16464
16828
  rangePickerType: rangePickerType,
@@ -18173,52 +18537,6 @@ const FiltersMultiSelectOptions = ({
18173
18537
  ;// ./src/components/Icon/index.ts
18174
18538
 
18175
18539
 
18176
- ;// ./src/components/ImageItem/ImageItem.tsx
18177
- function ImageItem_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
18178
-
18179
-
18180
-
18181
-
18182
- var ImageItem_ref = true ? {
18183
- name: "c5ejfv",
18184
- styles: "gap:8px;text-decoration:none"
18185
- } : 0;
18186
- const ImageItem = ({
18187
- children,
18188
- image,
18189
- avatarSize = 24,
18190
- link = '',
18191
- openLinkInNewTab = false,
18192
- className
18193
- }) => {
18194
- const theme = (0,react_namespaceObject.useTheme)();
18195
- const additionalProps = link ? {
18196
- href: link,
18197
- target: openLinkInNewTab ? '_blank' : undefined
18198
- } : {};
18199
- return (0,jsx_runtime_namespaceObject.jsxs)(Wrapper_Wrapper, {
18200
- css: ImageItem_ref,
18201
- as: link ? 'a' : 'div',
18202
- className: className,
18203
- "data-testid": "image-item",
18204
- ...additionalProps,
18205
- children: [(0,jsx_runtime_namespaceObject.jsx)(Avatar_Avatar, {
18206
- size: avatarSize,
18207
- image: image
18208
- }), (0,jsx_runtime_namespaceObject.jsx)("span", {
18209
- css: /*#__PURE__*/(0,react_namespaceObject.css)({
18210
- color: theme.colors.greyDarker,
18211
- fontSize: 14,
18212
- fontWeight: 500,
18213
- cursor: link ? 'pointer' : 'default',
18214
- '&:hover': {
18215
- color: link ? theme.colors.blue : theme.colors.greyDarker
18216
- }
18217
- }, true ? "" : 0, true ? "" : 0),
18218
- children: children
18219
- })]
18220
- });
18221
- };
18222
18540
  ;// ./src/components/ImageItem/index.ts
18223
18541
 
18224
18542
  ;// ./src/components/LinksTabBar/LinksTabBarBase.tsx
@@ -19140,18 +19458,47 @@ const Pagination = ({
19140
19458
  });
19141
19459
  };
19142
19460
  /* harmony default export */ const Pagination_Pagination = (Pagination);
19461
+ ;// ./src/utils/react19HocCompat.tsx
19462
+ /**
19463
+ * React 19 compatibility helper for Higher-Order Components (HOCs).
19464
+ *
19465
+ * React 19 has stricter requirements for component identification.
19466
+ * This utility ensures HOCs properly set displayName for better debugging
19467
+ * and React DevTools integration.
19468
+ *
19469
+ * @param hocName - The name of the HOC (e.g., 'WithPagination', 'WithLayout')
19470
+ * @param Component - The component being wrapped
19471
+ * @param WrappedComponent - The wrapper component function
19472
+ * @returns The wrapper component with proper displayName set
19473
+ */
19474
+
19475
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19476
+ function setHocDisplayName(hocName,
19477
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19478
+ Component, WrappedComponent) {
19479
+ const componentName = typeof Component === 'function' ?
19480
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19481
+ Component.displayName ||
19482
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19483
+ Component.name || 'Component' : 'Component';
19484
+ WrappedComponent.displayName = `${hocName}(${componentName})`;
19485
+ return WrappedComponent;
19486
+ }
19143
19487
  ;// ./src/components/Pagination/WithPagination.tsx
19144
19488
 
19145
19489
 
19490
+
19491
+
19146
19492
  const WithPagination = Component => {
19147
- const decoratedComp = props => (0,jsx_runtime_namespaceObject.jsx)(PaginationContextProvider, {
19148
- selectedPage: 1,
19149
- children: (0,jsx_runtime_namespaceObject.jsx)(Component, {
19150
- ...props
19151
- })
19152
- });
19153
- decoratedComp.displayName = `WithPagination(${Component.displayName})`;
19154
- return decoratedComp;
19493
+ function WrappedComponent(props) {
19494
+ return (0,jsx_runtime_namespaceObject.jsx)(PaginationContextProvider, {
19495
+ selectedPage: 1,
19496
+ children: (0,jsx_runtime_namespaceObject.jsx)(Component, {
19497
+ ...props
19498
+ })
19499
+ });
19500
+ }
19501
+ return setHocDisplayName('WithPagination', Component, WrappedComponent);
19155
19502
  };
19156
19503
  ;// ./src/components/Pagination/index.ts
19157
19504
 
@@ -19575,15 +19922,17 @@ const useTypeahead = ({
19575
19922
  const items = (0,external_react_namespaceObject.useMemo)(() => {
19576
19923
  return filteredChildren.map((child, index) => {
19577
19924
  if (! /*#__PURE__*/external_react_default().isValidElement(child)) return null;
19578
- const isActive = selectedItems.includes(child.props.value);
19925
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19926
+ const childElement = child;
19927
+ const isActive = selectedItems.includes(childElement.props.value);
19579
19928
  const {
19580
19929
  value,
19581
19930
  label,
19582
19931
  id,
19583
19932
  isDisabled
19584
- } = child.props;
19585
- return /*#__PURE__*/external_react_default().cloneElement(child, {
19586
- ...child.props,
19933
+ } = childElement.props;
19934
+ return /*#__PURE__*/external_react_default().cloneElement(childElement, {
19935
+ ...childElement.props,
19587
19936
  index,
19588
19937
  isActive,
19589
19938
  isDisabled,
@@ -19604,7 +19953,7 @@ const useTypeahead = ({
19604
19953
  value: id || value,
19605
19954
  input: inputValue,
19606
19955
  label
19607
- }) ?? child.props.children ?? label ?? value
19956
+ }) ?? childElement.props.children ?? label ?? value
19608
19957
  });
19609
19958
  });
19610
19959
  }, [children, selectedItems, inputValue]);
@@ -19613,7 +19962,9 @@ const useTypeahead = ({
19613
19962
  const needle = inputValue.toLowerCase();
19614
19963
  for (const child of filteredChildren) {
19615
19964
  if (! /*#__PURE__*/external_react_default().isValidElement(child)) continue;
19616
- const labelText = (child.props.label ?? child.props.value).toString();
19965
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19966
+ const childElement = child;
19967
+ const labelText = (childElement.props.label ?? childElement.props.value).toString();
19617
19968
  if (labelText.toLowerCase().startsWith(needle)) {
19618
19969
  return inputValue + labelText.slice(inputValue.length);
19619
19970
  }
@@ -21132,10 +21483,22 @@ const RadioWidget = props => {
21132
21483
  }, i)) : undefined
21133
21484
  });
21134
21485
  };
21486
+ ;// ./src/components/JsonSchemaForm/constants.ts
21487
+ const DEFAULT_AVATAR_SIZE = 24;
21135
21488
  ;// ./src/components/JsonSchemaForm/widgets/SelectWidget.tsx
21136
21489
 
21137
21490
 
21138
21491
 
21492
+
21493
+ const getAvatarNode = (option, uiOptions) => {
21494
+ const avatar = option.schema?.avatar;
21495
+ if (!avatar) return;
21496
+ const avatarSize = uiOptions.typeaheadAvatarSize ?? DEFAULT_AVATAR_SIZE;
21497
+ return (0,jsx_runtime_namespaceObject.jsx)(Avatar_Avatar, {
21498
+ size: avatarSize,
21499
+ image: avatar
21500
+ });
21501
+ };
21139
21502
  const SelectWidget = props => {
21140
21503
  const {
21141
21504
  id,
@@ -21156,6 +21519,7 @@ const SelectWidget = props => {
21156
21519
  enumDisabled = []
21157
21520
  } = options;
21158
21521
  const customPlaceholder = placeholder || uiSchema?.['ui:placeholder'];
21522
+ const selectUiOptions = uiSchema?.['ui:options'] || {};
21159
21523
  const isMultiple = !!multiple || Array.isArray(value);
21160
21524
  const items = Array.isArray(enumOptions) ? enumOptions : [];
21161
21525
  const handleChange = onChangeOverride ? onChangeOverride : value => {
@@ -21183,8 +21547,7 @@ const SelectWidget = props => {
21183
21547
  };
21184
21548
  const handleTypeaheadChange = (changedValue, isAdded) => {
21185
21549
  if (isMultiple) {
21186
- const currentSelected = Array.isArray(selectedItems) ? selectedItems : [];
21187
- const newSelected = isAdded ? [...currentSelected, changedValue] : currentSelected.filter(item => item !== changedValue);
21550
+ const newSelected = isAdded ? [...selectedItems, changedValue] : selectedItems.filter(item => item !== changedValue);
21188
21551
  handleFormChange(newSelected);
21189
21552
  } else {
21190
21553
  const newValue = isAdded ? changedValue : undefined;
@@ -21207,8 +21570,7 @@ const SelectWidget = props => {
21207
21570
  };
21208
21571
  const onRemoveSelectedClick = removedValue => {
21209
21572
  if (isMultiple) {
21210
- const currentSelected = Array.isArray(selectedItems) ? selectedItems : [];
21211
- const newSelected = currentSelected.filter(item => item !== removedValue);
21573
+ const newSelected = selectedItems.filter(item => item !== removedValue);
21212
21574
  handleChange(newSelected);
21213
21575
  } else {
21214
21576
  handleChange(undefined);
@@ -21233,15 +21595,13 @@ const SelectWidget = props => {
21233
21595
  label,
21234
21596
  input
21235
21597
  }) => highlightInputMatch(label, input),
21236
- children: items.map(({
21237
- label,
21238
- value
21239
- }) => (0,jsx_runtime_namespaceObject.jsx)(TypeaheadOption_TypeaheadOption, {
21240
- value: value,
21241
- label: label || value,
21242
- isDisabled: disabled || Array.isArray(enumDisabled) && enumDisabled.includes(value),
21243
- children: label || value
21244
- }, value))
21598
+ children: items.map(item => (0,jsx_runtime_namespaceObject.jsx)(TypeaheadOption_TypeaheadOption, {
21599
+ value: item.value,
21600
+ label: item.label || item.value,
21601
+ avatar: getAvatarNode(item, selectUiOptions),
21602
+ isDisabled: disabled || Array.isArray(enumDisabled) && enumDisabled.includes(item.value),
21603
+ children: item.label || item.value
21604
+ }, item.value))
21245
21605
  })
21246
21606
  });
21247
21607
  };
@@ -21579,6 +21939,7 @@ const JsonSchemaForm_Form = /*#__PURE__*/base_default()(UnstyledForm, true ? {
21579
21939
  styles: ".form-group{margin-bottom:16px;}.form-group:last-child{margin-bottom:0;}"
21580
21940
  } : 0);
21581
21941
 
21942
+
21582
21943
  ;// ./src/components/index.ts
21583
21944
 
21584
21945
 
@@ -21759,6 +22120,7 @@ const useTranslation = () => (0,external_react_namespaceObject.useContext)(Trans
21759
22120
 
21760
22121
 
21761
22122
 
22123
+
21762
22124
  /******/ return __webpack_exports__;
21763
22125
  /******/ })()
21764
22126
  ;