@connectif/ui-components 9.0.4 → 9.0.5

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,11 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [9.0.5] - 2026-06- 19
4
+
5
+ ### Added
6
+
7
+ - `InputLabel`: added focused visual state — the label color switches to `primary.main` when the associated input (linked via `htmlFor`) is focused.
8
+ - `InputLabel`: added `focused` prop to allow external control of the focused visual state, overriding the internal focus tracking.
9
+ - `InputLabel`: added `onClick` prop forwarded to the underlying `<label>` element.
10
+ - `ColorPicker`: added `disabled` prop.
11
+
12
+ ### Changed
13
+
14
+ - `Toolbar` story `ToolbarInDrawer`: drawer now starts closed, with an open button and a close button in the toolbar actions.
15
+ - `Dialog` story: dialog now starts closed, with a centered "Open Dialog" button to open it.
16
+ - `ConfirmationDialog` story: dialogs now start closed, with a centered "Open Dialog" button to open them.
17
+ - `Snackbar` story: removed the `Dialog` wrapper — buttons now render directly.
18
+
3
19
  ## [9.0.4] - 2026-06-08
4
20
 
5
21
  ### Changed
6
22
 
7
23
  - `LineChart`: now the secondary metric is positioned in left side of the chart.
8
24
 
25
+ ### Fixed
26
+
27
+ - `Stepper`: Stepper connector fixed when only label is specified in steps
28
+
9
29
  ## [9.0.3] - 2026-06-02
10
30
 
11
31
  ### Added
@@ -53,6 +53,11 @@ export type ColorPickerProps = {
53
53
  * @default 'auto'
54
54
  */
55
55
  mode?: ColorPickerMode;
56
+ /**
57
+ * (optional) Whether the color picker is disabled.
58
+ * @default false
59
+ */
60
+ disabled?: boolean;
56
61
  /**
57
62
  * A function to update color value
58
63
  */
@@ -21,6 +21,15 @@ export type InputLabelProps = React.PropsWithChildren<{
21
21
  * Show an info icon with the text as tooltip
22
22
  */
23
23
  infoText?: TooltipProps['title'];
24
+ /**
25
+ * Override the focused visual state. When provided, takes
26
+ * precedence over the internal focus tracking via `htmlFor`.
27
+ */
28
+ focused?: boolean;
29
+ /**
30
+ * Click handler for the label element.
31
+ */
32
+ onClick?: React.MouseEventHandler<HTMLLabelElement>;
24
33
  }>;
25
34
  /**
26
35
  * A label text to be shown along with form fields, like Select or TextFields, usually
@@ -44,6 +53,15 @@ declare const InputLabel: React.ForwardRefExoticComponent<{
44
53
  * Show an info icon with the text as tooltip
45
54
  */
46
55
  infoText?: TooltipProps["title"];
56
+ /**
57
+ * Override the focused visual state. When provided, takes
58
+ * precedence over the internal focus tracking via `htmlFor`.
59
+ */
60
+ focused?: boolean;
61
+ /**
62
+ * Click handler for the label element.
63
+ */
64
+ onClick?: React.MouseEventHandler<HTMLLabelElement>;
47
65
  } & {
48
66
  children?: React.ReactNode | undefined;
49
67
  } & React.RefAttributes<HTMLLabelElement>>;
package/dist/index.js CHANGED
@@ -19343,7 +19343,7 @@ function useDebouncedCallback(callback, wait) {
19343
19343
  }
19344
19344
 
19345
19345
  // src/components/input/DebouncedTextField.tsx
19346
- import { useEffect as useEffect12, useState as useState17 } from "react";
19346
+ import { useEffect as useEffect13, useState as useState18 } from "react";
19347
19347
 
19348
19348
  // src/components/input/TextField.tsx
19349
19349
  import * as React52 from "react";
@@ -19355,23 +19355,49 @@ import { styled as styled4 } from "@mui/material";
19355
19355
  import { jsx as jsx99, jsxs as jsxs44 } from "react/jsx-runtime";
19356
19356
  var getSeverityColor = ({ palette: palette2 }, severity) => severity === "error" ? palette2.error.main : palette2.grey[900];
19357
19357
  var StyledLabel = styled4("label", {
19358
- shouldForwardProp: (prop) => prop !== "severity"
19358
+ shouldForwardProp: (prop) => prop !== "severity" && prop !== "focused"
19359
19359
  })(
19360
- ({ severity, theme: theme2 }) => theme2.unstable_sx({
19360
+ ({ severity, focused, theme: theme2 }) => theme2.unstable_sx({
19361
19361
  display: "block",
19362
19362
  padding: "4px 0",
19363
19363
  ...variants["caption"],
19364
- color: getSeverityColor(theme2, severity)
19364
+ color: focused && severity !== "error" ? theme2.palette.primary.main : getSeverityColor(theme2, severity)
19365
19365
  })
19366
19366
  );
19367
19367
  var InputLabel = React50.forwardRef(
19368
- function InputLabel2({ htmlFor, sx, children, severity = "info", infoText }, ref) {
19368
+ function InputLabel2({
19369
+ htmlFor,
19370
+ sx,
19371
+ children,
19372
+ severity = "info",
19373
+ infoText,
19374
+ focused: focusedProp,
19375
+ onClick
19376
+ }, ref) {
19377
+ const [internalFocused, setInternalFocused] = React50.useState(false);
19378
+ const focused = focusedProp ?? internalFocused;
19379
+ React50.useEffect(() => {
19380
+ const input = htmlFor ? document.getElementById(htmlFor) : null;
19381
+ if (!input) {
19382
+ return;
19383
+ }
19384
+ const handleFocus = () => setInternalFocused(true);
19385
+ const handleBlur = () => setInternalFocused(false);
19386
+ input.addEventListener("focus", handleFocus);
19387
+ input.addEventListener("blur", handleBlur);
19388
+ return () => {
19389
+ input.removeEventListener("focus", handleFocus);
19390
+ input.removeEventListener("blur", handleBlur);
19391
+ };
19392
+ }, [htmlFor]);
19369
19393
  return /* @__PURE__ */ jsxs44(
19370
19394
  StyledLabel,
19371
19395
  {
19372
19396
  htmlFor,
19373
19397
  sx,
19374
19398
  severity,
19399
+ focused,
19400
+ onClick,
19375
19401
  ref,
19376
19402
  children: [
19377
19403
  children,
@@ -19749,7 +19775,7 @@ var TextField_default = TextField;
19749
19775
  // src/components/input/DebouncedTextField.tsx
19750
19776
  import { jsx as jsx102 } from "react/jsx-runtime";
19751
19777
  var DebouncedTextField = React53.forwardRef(function DebouncedTextField2({ value, onChange, debounce = 100, ...rest }, ref) {
19752
- const [text, setText] = useState17(value ?? "");
19778
+ const [text, setText] = useState18(value ?? "");
19753
19779
  const expectedChangeRef = React53.useRef(void 0);
19754
19780
  const onChangeDebounced = useDebouncedCallback(
19755
19781
  (e) => {
@@ -19760,7 +19786,7 @@ var DebouncedTextField = React53.forwardRef(function DebouncedTextField2({ value
19760
19786
  },
19761
19787
  debounce
19762
19788
  );
19763
- useEffect12(() => {
19789
+ useEffect13(() => {
19764
19790
  if (expectedChangeRef.current === value) {
19765
19791
  expectedChangeRef.current = void 0;
19766
19792
  } else {
@@ -22552,6 +22578,7 @@ var ColorPicker = React67.forwardRef(function ColorPickerWrapper({
22552
22578
  popoverZIndex,
22553
22579
  inputWidthStyle = "150px",
22554
22580
  mode = "auto",
22581
+ disabled = false,
22555
22582
  onChange
22556
22583
  }, ref) {
22557
22584
  const { t } = useTranslation();
@@ -22584,6 +22611,7 @@ var ColorPicker = React67.forwardRef(function ColorPickerWrapper({
22584
22611
  {
22585
22612
  iconId: value ? "color-square" : "transparent",
22586
22613
  size: "M",
22614
+ disabled,
22587
22615
  onClick: (event) => {
22588
22616
  setAnchorEl(event.currentTarget);
22589
22617
  },
@@ -22626,6 +22654,11 @@ var ColorPicker = React67.forwardRef(function ColorPickerWrapper({
22626
22654
  );
22627
22655
  }
22628
22656
  }, [value, internalPickerValue, colorChangeOccurred, allowEmpty, mode]);
22657
+ React67.useEffect(() => {
22658
+ if (disabled) {
22659
+ setAnchorEl(void 0);
22660
+ }
22661
+ }, [disabled]);
22629
22662
  React67.useEffect(() => {
22630
22663
  if (anchorEl) {
22631
22664
  const handleFocus = () => {
@@ -22663,14 +22696,14 @@ var ColorPicker = React67.forwardRef(function ColorPickerWrapper({
22663
22696
  {
22664
22697
  value: textFieldValue,
22665
22698
  label,
22699
+ disabled,
22666
22700
  sx: {
22667
22701
  width: inputWidthStyle,
22668
22702
  height: "36px !important"
22669
22703
  },
22670
22704
  inputSx: {
22671
22705
  fontFamily: "Source Sans Pro, sans-serif",
22672
- fontWeight: "400",
22673
- color: grey900
22706
+ fontWeight: "400"
22674
22707
  },
22675
22708
  placeholder: t("COLOR_PICKER.VALUE_NOT_DEFINED"),
22676
22709
  onChange: handleTextFieldChange,
@@ -23538,7 +23571,7 @@ import * as React73 from "react";
23538
23571
  // src/components/input/SelectPopover.tsx
23539
23572
  import * as React72 from "react";
23540
23573
  import { Grid as Grid4, Stack as Stack12 } from "@mui/material";
23541
- import { useState as useState30 } from "react";
23574
+ import { useState as useState31 } from "react";
23542
23575
  import InfiniteScroll from "react-infinite-scroll-component";
23543
23576
  import { jsx as jsx132, jsxs as jsxs62 } from "react/jsx-runtime";
23544
23577
  var defaultItemsColorStyles = {
@@ -23576,9 +23609,9 @@ var SelectPopover = function SelectPopover2({
23576
23609
  itemsTitle
23577
23610
  }) {
23578
23611
  const { t } = useTranslation();
23579
- const [searchText, setSearchText] = useState30("");
23580
- const [isScrollBottom, setIsScrollBottom] = useState30(false);
23581
- const [currentItems, setCurrentItems] = useState30([]);
23612
+ const [searchText, setSearchText] = useState31("");
23613
+ const [isScrollBottom, setIsScrollBottom] = useState31(false);
23614
+ const [currentItems, setCurrentItems] = useState31([]);
23582
23615
  const [currentSelectedItems, setCurrentSelectedItems] = React72.useState([]);
23583
23616
  const prevSelectedItemsIdsRef = React72.useRef([]);
23584
23617
  const onSearchTextChanged = (text) => {
@@ -28142,7 +28175,7 @@ import MuiTabs from "@mui/material/Tabs";
28142
28175
 
28143
28176
  // src/components/layout/SwipeableViews.tsx
28144
28177
  import * as React95 from "react";
28145
- import { useEffect as useEffect28, useRef as useRef33, useState as useState41 } from "react";
28178
+ import { useEffect as useEffect29, useRef as useRef33, useState as useState42 } from "react";
28146
28179
  import { jsx as jsx167 } from "react/jsx-runtime";
28147
28180
  var styles = {
28148
28181
  container: {
@@ -28179,9 +28212,9 @@ function SwipeableViews({
28179
28212
  const containerRef = useRef33(null);
28180
28213
  const scrollTimeout = useRef33(null);
28181
28214
  const scrollingMethod = useRef33("none");
28182
- const [previousIndex, setPreviousIndex] = useState41(index);
28215
+ const [previousIndex, setPreviousIndex] = useState42(index);
28183
28216
  const hideScrollAnimation = useRef33(true);
28184
- useEffect28(() => {
28217
+ useEffect29(() => {
28185
28218
  if (containerRef.current) {
28186
28219
  if (scrollingMethod.current === "manual") {
28187
28220
  scrollingMethod.current = "none";
@@ -28806,7 +28839,7 @@ var Toolbar_default = Toolbar;
28806
28839
 
28807
28840
  // src/components/toolbar/ToolbarTitle.tsx
28808
28841
  import * as React99 from "react";
28809
- import { useState as useState44 } from "react";
28842
+ import { useState as useState45 } from "react";
28810
28843
  import { jsx as jsx182, jsxs as jsxs89 } from "react/jsx-runtime";
28811
28844
  var ToolbarTitle = React99.forwardRef(function ToolbarTitle2({
28812
28845
  title,
@@ -28818,7 +28851,7 @@ var ToolbarTitle = React99.forwardRef(function ToolbarTitle2({
28818
28851
  const textElementRef = React99.useRef(
28819
28852
  null
28820
28853
  );
28821
- const [showHoverActions, setShowHoverActions] = useState44(false);
28854
+ const [showHoverActions, setShowHoverActions] = useState45(false);
28822
28855
  return /* @__PURE__ */ jsx182(Box_default2, { sx: { maxWidth: "100%" }, children: /* @__PURE__ */ jsx182(
28823
28856
  TextEllipsisTooltip_default,
28824
28857
  {