@connectif/ui-components 6.0.5 → 6.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [6.0.7] - 2026-04-09
4
+
5
+ ### Fixed
6
+
7
+ - Fixed crash when rendering a chip with a tooltip.
8
+
9
+ ### Changed
10
+
11
+ - `DateIntervalPicker` with input variant now supports selecting future dates.
12
+
13
+ ## [6.0.6] - 2026-04-08
14
+
15
+ ### Fixed
16
+
17
+ - Audit issues.
18
+ - Focus border state in `SelectComponent`.
19
+
20
+ ### Changed
21
+
22
+ - Scrollbars are hidden by default and shown on hover within the container.
23
+
24
+ ### Added
25
+
26
+ - `mdiEmailPlus` and `mdiEmailRemove` icons.
27
+
3
28
  ## [6.0.5] - 2026-03-31
4
29
 
5
30
  ### Added
@@ -649,7 +649,9 @@ export declare const icons: {
649
649
  'email-open': string;
650
650
  'email-open-outline': string;
651
651
  'email-outline': string;
652
+ 'email-plus': string;
652
653
  'email-plus-outline': string;
654
+ 'email-remove': string;
653
655
  'email-secure': string;
654
656
  'email-variant': string;
655
657
  emby: string;
@@ -95,12 +95,16 @@ export type DateIntervalPickerProps = (DateIntervalPickerDefault | DateIntervalP
95
95
  disabled?: boolean;
96
96
  /**
97
97
  * The minimum date allowed to be selected in the date interval.
98
- * By default it will be the maxDate minus the maxSelectableDays
98
+ * By default:
99
+ * Input variant: it will allow selecting dates from 1900-01-01 in input.
100
+ * Other variant: it will be the maxDate minus the maxSelectableDays
99
101
  */
100
102
  minDate?: Date;
101
103
  /**
102
104
  * The maximum date allowed to be selected in the date interval.
103
- * By default it will be the current date
105
+ * By default:
106
+ * Input variant: it will be the current date, or 2100-12-31 when maxDate is not provided.
107
+ * Other variant: it will be the current date
104
108
  */
105
109
  maxDate?: Date;
106
110
  };
@@ -4,10 +4,12 @@ export type DateIntervalRangeSelectorProps = {
4
4
  color: string;
5
5
  minDate: Date;
6
6
  maxDate: Date;
7
+ maxSelectableDays: number;
8
+ handleSelectionLimits?: boolean;
7
9
  comparisonColor: string;
8
10
  intersectionColor: string;
9
11
  showTime: boolean;
10
12
  onChange: (state: DateIntervalPickerState) => void;
11
13
  };
12
- declare const DateIntervalRangeSelector: ({ state, color, minDate, maxDate, comparisonColor, intersectionColor, showTime, onChange }: DateIntervalRangeSelectorProps) => import("react/jsx-runtime").JSX.Element;
14
+ declare const DateIntervalRangeSelector: ({ state, color, minDate, maxDate, maxSelectableDays, handleSelectionLimits, comparisonColor, intersectionColor, showTime, onChange }: DateIntervalRangeSelectorProps) => import("react/jsx-runtime").JSX.Element;
13
15
  export default DateIntervalRangeSelector;
package/dist/index.js CHANGED
@@ -1508,8 +1508,10 @@ import {
1508
1508
  mdiEmailOpen,
1509
1509
  mdiEmailOpenOutline,
1510
1510
  mdiEmailOutline,
1511
+ mdiEmailPlus,
1511
1512
  mdiEmailPlusOutline,
1512
1513
  mdiEmailLock,
1514
+ mdiEmailRemove,
1513
1515
  mdiEmailVariant,
1514
1516
  mdiEmoticon,
1515
1517
  mdiEmoticonCool,
@@ -3311,7 +3313,9 @@ var icons = {
3311
3313
  "email-open": mdiEmailOpen,
3312
3314
  "email-open-outline": mdiEmailOpenOutline,
3313
3315
  "email-outline": mdiEmailOutline,
3316
+ "email-plus": mdiEmailPlus,
3314
3317
  "email-plus-outline": mdiEmailPlusOutline,
3318
+ "email-remove": mdiEmailRemove,
3315
3319
  "email-secure": mdiEmailLock,
3316
3320
  "email-variant": mdiEmailVariant,
3317
3321
  emby: "M11,2L6,7L7,8L2,13L7,18L8,17L13,22L18,17L17,16L22,11L17,6L16,7L11,2M10,8.5L16,12L10,15.5V8.5Z",
@@ -11122,17 +11126,20 @@ var Chip = React28.forwardRef(function Chip2({
11122
11126
  };
11123
11127
  const iconSizeCurrent = iconSize ?? iconSizes3[size];
11124
11128
  const variantStyles3 = getVariantStyles(theme2, variant);
11125
- const getIcon = (iconId2) => /* @__PURE__ */ jsx55(Tooltip_default, { title: iconTooltip || "", children: /* @__PURE__ */ jsx55(
11126
- Icon_default,
11127
- {
11128
- id: iconId2,
11129
- size: iconSizeCurrent,
11130
- sx: {
11131
- color: iconColor ?? variantStyles3.iconColor,
11132
- cursor: !onClick ? "default" : void 0
11129
+ const getIcon = (iconId2) => {
11130
+ const icon = /* @__PURE__ */ jsx55(
11131
+ Icon_default,
11132
+ {
11133
+ id: iconId2,
11134
+ size: iconSizeCurrent,
11135
+ sx: {
11136
+ color: iconColor ?? variantStyles3.iconColor,
11137
+ cursor: !onClick ? "default" : void 0
11138
+ }
11133
11139
  }
11134
- }
11135
- ) });
11140
+ );
11141
+ return iconTooltip ? /* @__PURE__ */ jsx55(Tooltip_default, { title: iconTooltip, children: icon }) : icon;
11142
+ };
11136
11143
  const deleteIcon = /* @__PURE__ */ jsxs21(Stack_default, { direction: "row", alignItems: "center", children: [
11137
11144
  iconId && iconRight && getIcon(iconId),
11138
11145
  isDeleteable && onDelete && /* @__PURE__ */ jsx55(
@@ -11472,8 +11479,11 @@ var globalStyles = {
11472
11479
  ".Slim-Vertical-Scroll": {
11473
11480
  "@-moz-document url-prefix()": {
11474
11481
  "&": {
11475
- scrollbarColor: "silver transparent",
11482
+ scrollbarColor: "transparent transparent",
11476
11483
  scrollbarWidth: "auto"
11484
+ },
11485
+ "&:hover": {
11486
+ scrollbarColor: "silver transparent"
11477
11487
  }
11478
11488
  },
11479
11489
  overflow: "auto",
@@ -11489,15 +11499,23 @@ var globalStyles = {
11489
11499
  borderRadius: "4px"
11490
11500
  },
11491
11501
  "&::-webkit-scrollbar-thumb": {
11492
- background: "silver",
11502
+ background: "transparent",
11493
11503
  borderRadius: "4px"
11504
+ },
11505
+ "&:hover": {
11506
+ "&::-webkit-scrollbar-thumb": {
11507
+ background: "silver"
11508
+ }
11494
11509
  }
11495
11510
  },
11496
11511
  ".Slim-Horizontal-Scroll": {
11497
11512
  "@-moz-document url-prefix()": {
11498
11513
  "&": {
11499
- scrollbarColor: "silver transparent",
11514
+ scrollbarColor: "transparent transparent",
11500
11515
  scrollbarWidth: "auto"
11516
+ },
11517
+ "&:hover": {
11518
+ scrollbarColor: "silver transparent"
11501
11519
  }
11502
11520
  },
11503
11521
  overflow: "auto",
@@ -11512,14 +11530,22 @@ var globalStyles = {
11512
11530
  background: "transparent"
11513
11531
  },
11514
11532
  "&::-webkit-scrollbar-thumb": {
11515
- background: "silver"
11533
+ background: "transparent"
11534
+ },
11535
+ "&:hover": {
11536
+ "&::-webkit-scrollbar-thumb": {
11537
+ background: "silver"
11538
+ }
11516
11539
  }
11517
11540
  },
11518
11541
  ".Slim-Vertical-Horizontal-Scroll": {
11519
11542
  "@-moz-document url-prefix()": {
11520
11543
  "&": {
11521
- scrollbarColor: "silver transparent",
11544
+ scrollbarColor: "transparent transparent",
11522
11545
  scrollbarWidth: "auto"
11546
+ },
11547
+ "&:hover": {
11548
+ scrollbarColor: "silver transparent"
11523
11549
  }
11524
11550
  },
11525
11551
  overflow: "auto",
@@ -11535,7 +11561,12 @@ var globalStyles = {
11535
11561
  background: "transparent"
11536
11562
  },
11537
11563
  "&::-webkit-scrollbar-thumb": {
11538
- background: "silver"
11564
+ background: "transparent"
11565
+ },
11566
+ "&:hover": {
11567
+ "&::-webkit-scrollbar-thumb": {
11568
+ background: "silver"
11569
+ }
11539
11570
  }
11540
11571
  },
11541
11572
  ".Fade-In-Out": {
@@ -20453,6 +20484,8 @@ var DateIntervalRangeSelector = ({
20453
20484
  color: color2,
20454
20485
  minDate,
20455
20486
  maxDate,
20487
+ maxSelectableDays,
20488
+ handleSelectionLimits = false,
20456
20489
  comparisonColor,
20457
20490
  intersectionColor,
20458
20491
  showTime,
@@ -20462,8 +20495,14 @@ var DateIntervalRangeSelector = ({
20462
20495
  const dateInputFormat = getDateInputFormatForLocale(locale);
20463
20496
  const { t } = useTranslation();
20464
20497
  const dateInputFormatPlaceholder = dateInputFormat.replace(/Y/g, t("DATE_COMPONENTS.YEAR_LETTER")).replace(/M/g, t("DATE_COMPONENTS.MONTH_LETTER")).replace(/D/g, t("DATE_COMPONENTS.DAY_LETTER"));
20465
- const minDateTz = tz4(minDate, timezone);
20466
- const maxDateTz = tz4(maxDate, timezone);
20498
+ const [minDateTz, setMinDateTz] = React58.useState(tz4(minDate, timezone));
20499
+ const [maxDateTz, setMaxDateTz] = React58.useState(tz4(maxDate, timezone));
20500
+ React58.useEffect(() => {
20501
+ setMinDateTz(tz4(minDate, timezone));
20502
+ }, [minDate, timezone]);
20503
+ React58.useEffect(() => {
20504
+ setMaxDateTz(tz4(maxDate, timezone));
20505
+ }, [maxDate, timezone]);
20467
20506
  const formatSimpleDate = (date) => tz4(
20468
20507
  { year: date.year, month: date.month, date: date.day },
20469
20508
  timezone
@@ -20673,7 +20712,25 @@ var DateIntervalRangeSelector = ({
20673
20712
  const date = getSimpleDateFromString(value);
20674
20713
  onChange(setDateOnFocusableInput(date, focusableInput));
20675
20714
  };
20715
+ const setLimitDates = (date) => {
20716
+ if (!date || !maxSelectableDays) {
20717
+ setMinDateTz(tz4(minDate, timezone));
20718
+ setMaxDateTz(tz4(maxDate, timezone));
20719
+ return;
20720
+ }
20721
+ const baseDate = tz4(
20722
+ { year: date.year, month: date.month, date: date.day },
20723
+ timezone
20724
+ );
20725
+ setMinDateTz(baseDate);
20726
+ setMaxDateTz(tz4(baseDate, timezone).add(maxSelectableDays - 1, "days"));
20727
+ };
20676
20728
  const handleSelectDate = (date) => {
20729
+ if (handleSelectionLimits) {
20730
+ setLimitDates(
20731
+ state.highlightedInput === "startDate" ? date : void 0
20732
+ );
20733
+ }
20677
20734
  const newState = setDateOnFocusableInput(date, state.highlightedInput);
20678
20735
  moveFocusToFollowingInput(newState);
20679
20736
  };
@@ -20831,7 +20888,7 @@ var DateIntervalRangeSelector = ({
20831
20888
  ] : []
20832
20889
  ],
20833
20890
  intersectionColor,
20834
- focusedDate: state.focusedDateInCalendar,
20891
+ focusedDate: state.focusedDateInCalendar ?? dateToSimpleDate(tz4(timezone).toDate(), timezone),
20835
20892
  onSelect: handleSelectDate
20836
20893
  }
20837
20894
  )
@@ -21132,6 +21189,8 @@ var DateIntervalPickerPopover = ({
21132
21189
  intersectionColor,
21133
21190
  maxDate,
21134
21191
  minDate,
21192
+ maxSelectableDays,
21193
+ handleSelectionLimits: variant === "input",
21135
21194
  showTime: !!showTime,
21136
21195
  onChange: setState
21137
21196
  }
@@ -21367,6 +21426,8 @@ var DateIntervalPickerInputButton_default = DateIntervalPickerInputButton;
21367
21426
 
21368
21427
  // src/components/input/date-interval-picker/DateIntervalPicker.tsx
21369
21428
  import { jsx as jsx116, jsxs as jsxs54 } from "react/jsx-runtime";
21429
+ var DEFAULT_MIN_DATE = { year: 1900, month: 0, date: 1 };
21430
+ var DEFAULT_MAX_DATE = { year: 2100, month: 11, date: 31 };
21370
21431
  var DateIntervalPicker = ({
21371
21432
  color: color2,
21372
21433
  maxSelectableDays,
@@ -21397,8 +21458,8 @@ var DateIntervalPicker = ({
21397
21458
  }
21398
21459
  setAnchorEl(null);
21399
21460
  };
21400
- const internalMaxDate = maxDate ?? tz7(timezone).toDate();
21401
- const internalMinDate = minDate ?? tz7(internalMaxDate, timezone).subtract(maxSelectableDays - 1, "days").toDate();
21461
+ const internalMaxDate = maxDate ?? (rest.variant !== "input" ? tz7(timezone).toDate() : tz7(DEFAULT_MAX_DATE, timezone).toDate());
21462
+ const internalMinDate = minDate ?? (rest.variant !== "input" ? tz7(internalMaxDate, timezone).subtract(maxSelectableDays - 1, "days").toDate() : tz7(DEFAULT_MIN_DATE, timezone).toDate());
21402
21463
  const displayEndDate = rest.endDate !== void 0 ? rest.variant !== "input" ? getDisplayEndDate(rest.endDate, timezone, !!rest.showTime) : rest.endDate : void 0;
21403
21464
  const isEndDateVisible = displayEndDate !== void 0 && !isSameDate(rest.startDate, displayEndDate);
21404
21465
  return /* @__PURE__ */ jsxs54("div", { style: { display: "inline-flex" }, children: [
@@ -21810,6 +21871,12 @@ var Select = function Select2({
21810
21871
  {
21811
21872
  className: `Cn-Select ${className}`,
21812
21873
  sx: {
21874
+ ...variant !== "transparent" && {
21875
+ "&.Mui-focused": {
21876
+ backgroundColor: "white",
21877
+ borderColor: palette2.primary.main
21878
+ }
21879
+ },
21813
21880
  ...variant === "transparent" && {
21814
21881
  backgroundColor: "transparent",
21815
21882
  borderColor: "transparent",
@@ -21913,7 +21980,8 @@ var Select = function Select2({
21913
21980
  sx: {
21914
21981
  ...variant !== "transparent" && {
21915
21982
  "&.Mui-focused": {
21916
- backgroundColor: "white"
21983
+ backgroundColor: "white",
21984
+ borderColor: palette2.primary.main
21917
21985
  }
21918
21986
  },
21919
21987
  ...variant === "transparent" && {
@@ -23140,7 +23208,7 @@ import * as React71 from "react";
23140
23208
  // src/components/input/SelectPopover.tsx
23141
23209
  import * as React70 from "react";
23142
23210
  import { Grid as Grid4, Stack as Stack12 } from "@mui/material";
23143
- import { useState as useState27 } from "react";
23211
+ import { useState as useState28 } from "react";
23144
23212
  import InfiniteScroll from "react-infinite-scroll-component";
23145
23213
  import { jsx as jsx130, jsxs as jsxs60 } from "react/jsx-runtime";
23146
23214
  var defaultItemsColorStyles = {
@@ -23178,9 +23246,9 @@ var SelectPopover = function SelectPopover2({
23178
23246
  itemsTitle
23179
23247
  }) {
23180
23248
  const { t } = useTranslation();
23181
- const [searchText, setSearchText] = useState27("");
23182
- const [isScrollBottom, setIsScrollBottom] = useState27(false);
23183
- const [currentItems, setCurrentItems] = useState27([]);
23249
+ const [searchText, setSearchText] = useState28("");
23250
+ const [isScrollBottom, setIsScrollBottom] = useState28(false);
23251
+ const [currentItems, setCurrentItems] = useState28([]);
23184
23252
  const [currentSelectedItems, setCurrentSelectedItems] = React70.useState([]);
23185
23253
  const prevSelectedItemsIdsRef = React70.useRef([]);
23186
23254
  const onSearchTextChanged = (text) => {
@@ -23825,37 +23893,25 @@ var AutocompleteInputSelection = function AutocompleteInputSelection2({
23825
23893
  }
23826
23894
  }
23827
23895
  ),
23828
- /* @__PURE__ */ jsxs62(Stack_default, { whiteSpace: "nowrap", flex: "1 1 auto", minWidth: 0, children: [
23829
- !Array.isArray(value) && !!value && /* @__PURE__ */ jsx132(
23830
- TextEllipsis_default,
23831
- {
23832
- typographyVariant: "body2",
23833
- color: palette2.grey[900],
23834
- text: renderLabel(
23835
- value
23836
- )
23837
- }
23838
- ),
23839
- Array.isArray(value) && /* @__PURE__ */ jsx132(
23840
- ChipViewer_default,
23841
- {
23842
- values: value,
23843
- ...!disabled && {
23844
- onRemoveChip: (event, id) => {
23845
- onRemoveValue(
23846
- event,
23847
- Array.isArray(value) ? value.filter(
23848
- (v) => v !== id
23849
- ) : ""
23850
- );
23851
- }
23852
- },
23853
- numberLines: 1,
23854
- renderChipLabel: (id) => renderLabel(id),
23855
- forceRecalculate: disabled
23856
- }
23857
- )
23858
- ] })
23896
+ /* @__PURE__ */ jsx132(Stack_default, { whiteSpace: "nowrap", flex: "1 1 auto", minWidth: 0, children: Array.isArray(value) && /* @__PURE__ */ jsx132(
23897
+ ChipViewer_default,
23898
+ {
23899
+ values: value,
23900
+ ...!disabled && {
23901
+ onRemoveChip: (event, id) => {
23902
+ onRemoveValue(
23903
+ event,
23904
+ Array.isArray(value) ? value.filter(
23905
+ (v) => v !== id
23906
+ ) : ""
23907
+ );
23908
+ }
23909
+ },
23910
+ numberLines: 1,
23911
+ renderChipLabel: (id) => renderLabel(id),
23912
+ forceRecalculate: disabled
23913
+ }
23914
+ ) })
23859
23915
  ]
23860
23916
  }
23861
23917
  );
@@ -23945,7 +24001,7 @@ var AutocompleteInput = function AutocompleteInput2({
23945
24001
  },
23946
24002
  maxLength: maxValueLength,
23947
24003
  placeholder: !canAddValues ? maxValuesText || t("AUTOCOMPLETE.MAX_VALUES") : Array.isArray(value) && value.length > 0 || !Array.isArray(value) && !!value ? "" : placeholder,
23948
- value: inputValue,
24004
+ value: inputValue || (!Array.isArray(value) ? renderLabel(value) : ""),
23949
24005
  multiline: false,
23950
24006
  disabled: disabled || !canAddValues,
23951
24007
  onChange: (event) => {
@@ -23962,8 +24018,6 @@ var AutocompleteInput = function AutocompleteInput2({
23962
24018
  value.length - 1
23963
24019
  )
23964
24020
  );
23965
- } else if (!inputValue && !Array.isArray(value) && value) {
23966
- onRemoveValue(event, "");
23967
24021
  }
23968
24022
  break;
23969
24023
  case "Enter":
@@ -23985,7 +24039,7 @@ var AutocompleteInput = function AutocompleteInput2({
23985
24039
  }
23986
24040
  },
23987
24041
  containerRef,
23988
- startAdornment: /* @__PURE__ */ jsx133(
24042
+ startAdornment: multiple ? /* @__PURE__ */ jsx133(
23989
24043
  AutocompleteInputSelection_default,
23990
24044
  {
23991
24045
  value,
@@ -23996,7 +24050,7 @@ var AutocompleteInput = function AutocompleteInput2({
23996
24050
  onRemoveValue,
23997
24051
  disabled
23998
24052
  }
23999
- ),
24053
+ ) : void 0,
24000
24054
  endAdornment: /* @__PURE__ */ jsxs63(
24001
24055
  Stack_default,
24002
24056
  {
@@ -24449,12 +24503,13 @@ var Autocomplete = function Autocomplete2({
24449
24503
  const onSearchValueChange = (event, inputValue2) => {
24450
24504
  setInputValue(inputValue2);
24451
24505
  setDirty(true);
24506
+ if (!inputValue2 && !multiple && value) {
24507
+ onChange && onChange(event, "");
24508
+ }
24452
24509
  if (onSearch) {
24453
24510
  onSearch(inputValue2);
24454
24511
  if (inputValue2 && !isOpenPopover) {
24455
24512
  openPopover();
24456
- } else if (!inputValue2 && !multiple && value) {
24457
- onChange && onChange(event, "");
24458
24513
  }
24459
24514
  return;
24460
24515
  }
@@ -27724,7 +27779,7 @@ import MuiTabs from "@mui/material/Tabs";
27724
27779
 
27725
27780
  // src/components/layout/SwipeableViews.tsx
27726
27781
  import * as React93 from "react";
27727
- import { useEffect as useEffect26, useRef as useRef32, useState as useState38 } from "react";
27782
+ import { useEffect as useEffect27, useRef as useRef32, useState as useState39 } from "react";
27728
27783
  import { jsx as jsx165 } from "react/jsx-runtime";
27729
27784
  var styles = {
27730
27785
  container: {
@@ -27761,9 +27816,9 @@ function SwipeableViews({
27761
27816
  const containerRef = useRef32(null);
27762
27817
  const scrollTimeout = useRef32(null);
27763
27818
  const scrollingMethod = useRef32("none");
27764
- const [previousIndex, setPreviousIndex] = useState38(index);
27819
+ const [previousIndex, setPreviousIndex] = useState39(index);
27765
27820
  const hideScrollAnimation = useRef32(true);
27766
- useEffect26(() => {
27821
+ useEffect27(() => {
27767
27822
  if (containerRef.current) {
27768
27823
  if (scrollingMethod.current === "manual") {
27769
27824
  scrollingMethod.current = "none";
@@ -28388,7 +28443,7 @@ var Toolbar_default = Toolbar;
28388
28443
 
28389
28444
  // src/components/toolbar/ToolbarTitle.tsx
28390
28445
  import * as React97 from "react";
28391
- import { useState as useState41 } from "react";
28446
+ import { useState as useState42 } from "react";
28392
28447
  import { jsx as jsx180, jsxs as jsxs87 } from "react/jsx-runtime";
28393
28448
  var ToolbarTitle = React97.forwardRef(function ToolbarTitle2({
28394
28449
  title,
@@ -28400,7 +28455,7 @@ var ToolbarTitle = React97.forwardRef(function ToolbarTitle2({
28400
28455
  const textElementRef = React97.useRef(
28401
28456
  null
28402
28457
  );
28403
- const [showHoverActions, setShowHoverActions] = useState41(false);
28458
+ const [showHoverActions, setShowHoverActions] = useState42(false);
28404
28459
  return /* @__PURE__ */ jsx180(Box_default2, { sx: { maxWidth: "100%" }, children: /* @__PURE__ */ jsx180(
28405
28460
  TextEllipsisTooltip_default,
28406
28461
  {