@hitachivantara/uikit-react-core 6.8.0 → 6.8.2

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 (37) hide show
  1. package/dist/AppSwitcher/Action/Action.js +2 -2
  2. package/dist/Badge/Badge.js +2 -0
  3. package/dist/Badge/Badge.styles.js +10 -4
  4. package/dist/BaseDropdown/BaseDropdown.js +6 -4
  5. package/dist/BaseDropdown/BaseDropdownPanel.js +6 -6
  6. package/dist/BreadCrumb/BreadCrumb.js +1 -1
  7. package/dist/Calendar/CalendarHeader/CalendarHeader.js +1 -1
  8. package/dist/Calendar/SingleCalendar/SingleCalendar.js +1 -1
  9. package/dist/Carousel/Carousel.js +1 -1
  10. package/dist/CheckBox/CheckBox.js +1 -1
  11. package/dist/DatePicker/DatePicker.js +9 -8
  12. package/dist/Dropdown/Dropdown.js +2 -2
  13. package/dist/Dropdown/List/List.js +1 -1
  14. package/dist/FileUploader/FileUploader.js +1 -1
  15. package/dist/FilterGroup/FilterContent/FilterContent.js +2 -2
  16. package/dist/FilterGroup/FilterGroup.js +1 -1
  17. package/dist/FilterGroup/LeftPanel/LeftPanel.js +2 -2
  18. package/dist/Input/Input.js +2 -2
  19. package/dist/List/List.js +2 -2
  20. package/dist/NumberInput/NumberInput.js +1 -1
  21. package/dist/QueryBuilder/Rule/Attribute.js +1 -0
  22. package/dist/QueryBuilder/Rule/Operator.js +1 -0
  23. package/dist/QueryBuilder/Rule/Rule.js +43 -51
  24. package/dist/QueryBuilder/Rule/Rule.styles.js +14 -12
  25. package/dist/QueryBuilder/RuleGroup.js +1 -1
  26. package/dist/Radio/Radio.js +1 -1
  27. package/dist/Section/Section.js +1 -1
  28. package/dist/SelectionList/SelectionList.js +1 -1
  29. package/dist/Switch/Switch.js +2 -2
  30. package/dist/Table/renderers/renderers.js +1 -1
  31. package/dist/TagsInput/TagsInput.js +1 -1
  32. package/dist/TextArea/TextArea.js +2 -2
  33. package/dist/TimePicker/Placeholder.js +36 -31
  34. package/dist/TimePicker/TimePicker.js +15 -13
  35. package/dist/VerticalNavigation/NavigationSlider/NavigationSlider.js +1 -1
  36. package/dist/utils/Callout.js +1 -1
  37. package/package.json +4 -4
@@ -5,11 +5,11 @@ import { useUniqueId } from "../../hooks/useUniqueId.js";
5
5
  import { HvIcon } from "../../icons.js";
6
6
  import { useClasses } from "./Action.styles.js";
7
7
  import { staticClasses } from "./Action.styles.js";
8
- import { HvAvatar } from "../../Avatar/Avatar.js";
9
- import { HvListItem } from "../../ListContainer/ListItem/ListItem.js";
10
8
  import { HvTypography } from "../../Typography/Typography.js";
11
9
  import { HvOverflowTooltip } from "../../OverflowTooltip/OverflowTooltip.js";
12
10
  import { HvTooltip } from "../../Tooltip/Tooltip.js";
11
+ import { HvAvatar } from "../../Avatar/Avatar.js";
12
+ import { HvListItem } from "../../ListContainer/ListItem/ListItem.js";
13
13
  const HvAppSwitcherAction = ({
14
14
  id,
15
15
  className,
@@ -18,6 +18,7 @@ const HvBadge = forwardRef(function HvBadge2(props, ref) {
18
18
  ...others
19
19
  } = useDefaultProps("HvBadge", props);
20
20
  const { classes, cx } = useClasses(classesProp);
21
+ const hasContent = !!(children || icon);
21
22
  const label = useMemo(() => {
22
23
  if (typeof labelProp !== "number") return labelProp;
23
24
  if (labelProp <= 0) return null;
@@ -33,6 +34,7 @@ const HvBadge = forwardRef(function HvBadge2(props, ref) {
33
34
  style: mergeStyles(style, {
34
35
  "--bg-color": color && getColor(color)
35
36
  }),
37
+ "data-badge-inline": !hasContent ? "" : void 0,
36
38
  className: cx(classes.badge, {
37
39
  [classes.badgeHidden]: label == null,
38
40
  [classes.badgeIcon]: icon,
@@ -15,9 +15,11 @@ const { staticClasses, useClasses } = createClasses("HvBadge", {
15
15
  },
16
16
  /** class applied to the badge */
17
17
  badge: {
18
- position: "absolute",
19
- top: 0,
20
- left: "100%",
18
+ "&:not([data-badge-inline])": {
19
+ position: "absolute",
20
+ top: 0,
21
+ left: "100%"
22
+ },
21
23
  ...theme.typography.caption2,
22
24
  color: theme.colors.textDimmed,
23
25
  borderRadius: theme.radii.full,
@@ -27,6 +29,10 @@ const { staticClasses, useClasses } = createClasses("HvBadge", {
27
29
  padding: "0 5px",
28
30
  wordBreak: "keep-all",
29
31
  textAlign: "center",
32
+ "&$badgeIcon": {
33
+ top: "1px",
34
+ left: "calc(100% - 7px)"
35
+ },
30
36
  ":empty": {
31
37
  height: 8,
32
38
  width: 8,
@@ -37,7 +43,7 @@ const { staticClasses, useClasses } = createClasses("HvBadge", {
37
43
  badgeHidden: {
38
44
  display: "none"
39
45
  },
40
- badgeIcon: { top: "1px", left: "calc(100% - 7px)" },
46
+ badgeIcon: {},
41
47
  badgeOneDigit: { padding: 0, width: "16px" }
42
48
  });
43
49
  export {
@@ -1,5 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useState, useId, useCallback, isValidElement, cloneElement, Fragment } from "react";
3
+ import useEventCallback from "@mui/utils/useEventCallback";
3
4
  import useForkRef from "@mui/utils/useForkRef";
4
5
  import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
5
6
  import { useControlled } from "../hooks/useControlled.js";
@@ -139,6 +140,10 @@ const HvBaseDropdown = forwardRef(function BaseDropdown(props, ref) {
139
140
  const hasCustomHeader = !!HeaderComponentProp;
140
141
  const HeaderComponent = HeaderComponentProp || "div";
141
142
  const RootComponent = HeaderComponentProp ? Fragment : "div";
143
+ const onFirstUpdate = useEventCallback((state) => {
144
+ setComputedPlacement(state.placement);
145
+ onContainerCreation?.(state.elements?.popper ?? null, state);
146
+ });
142
147
  return /* @__PURE__ */ jsxs(RootComponent, { ...!hasCustomHeader && { className: classes.root }, children: [
143
148
  /* @__PURE__ */ jsx(
144
149
  HeaderComponent,
@@ -176,10 +181,7 @@ const HvBaseDropdown = forwardRef(function BaseDropdown(props, ref) {
176
181
  disablePortal,
177
182
  anchorEl: referenceElement,
178
183
  onToggle: handleToggle,
179
- onFirstUpdate: (state) => {
180
- setComputedPlacement(state.placement);
181
- onContainerCreation?.(state.elements?.popper ?? null, state);
182
- },
184
+ onFirstUpdate,
183
185
  popperOptions: popperProps,
184
186
  children
185
187
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useRef, useState } from "react";
2
+ import { useRef, useState, useMemo } from "react";
3
3
  import ClickAwayListener from "@mui/material/ClickAwayListener";
4
4
  import Popper from "@mui/material/Popper";
5
5
  import { useDefaultProps, useTheme, createClasses } from "@hitachivantara/uikit-react-utils";
@@ -30,7 +30,7 @@ const HvDropdownPanel = (props) => {
30
30
  anchorEl,
31
31
  disablePortal,
32
32
  modifiers: modifiersProp,
33
- popperOptions,
33
+ popperOptions: popperOptionsProp,
34
34
  onToggle,
35
35
  onClickAway,
36
36
  onFirstUpdate,
@@ -45,6 +45,9 @@ const HvDropdownPanel = (props) => {
45
45
  modifiers: modifiersProp,
46
46
  onPlacementChange: setPlacement
47
47
  });
48
+ const popperOptions = useMemo(() => {
49
+ return { ...popperOptionsProp, onFirstUpdate };
50
+ }, [onFirstUpdate, popperOptionsProp]);
48
51
  const handleKeyDown = (event) => {
49
52
  if (isKey(event, "Esc")) {
50
53
  onToggle?.(event);
@@ -69,10 +72,7 @@ const HvDropdownPanel = (props) => {
69
72
  className: cx(classes.container, className),
70
73
  modifiers,
71
74
  onKeyDown: handleKeyDown,
72
- popperOptions: {
73
- onFirstUpdate,
74
- ...popperOptions
75
- },
75
+ popperOptions,
76
76
  ...others,
77
77
  children: /* @__PURE__ */ jsx(ClickAwayListener, { onClickAway, children: /* @__PURE__ */ jsx(
78
78
  HvPanel,
@@ -6,9 +6,9 @@ import { useClasses } from "./BreadCrumb.styles.js";
6
6
  import { staticClasses } from "./BreadCrumb.styles.js";
7
7
  import { pathWithSubMenu, removeExtension } from "./utils.js";
8
8
  import { HvPathElement } from "./PathElement/PathElement.js";
9
- import { HvBreadCrumbPage } from "./Page/Page.js";
10
9
  import { HvIconButton } from "../IconButton/IconButton.js";
11
10
  import { HvTypography } from "../Typography/Typography.js";
11
+ import { HvBreadCrumbPage } from "./Page/Page.js";
12
12
  const HomeIcon = (props) => /* @__PURE__ */ jsx(SvgBase, { viewBox: "0 0 256 256", width: "16", height: "16", ...props, children: /* @__PURE__ */ jsx("path", { d: "M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z" }) });
13
13
  const HvBreadCrumb = forwardRef(function HvBreadCrumb2(props, ref) {
14
14
  const {
@@ -5,9 +5,9 @@ import { isKey } from "../../utils/keyboardUtils.js";
5
5
  import { DEFAULT_LOCALE, isRange, getLocaleDateFormat, isDate, getFormattedDate, getStringFromDate, parseDateString, isSameDay } from "../utils.js";
6
6
  import { useClasses } from "./CalendarHeader.styles.js";
7
7
  import { staticClasses } from "./CalendarHeader.styles.js";
8
- import { HvInput } from "../../Input/Input.js";
9
8
  import { HvFormElementDescriptorsContext } from "../../FormElement/context.js";
10
9
  import { HvTypography } from "../../Typography/Typography.js";
10
+ import { HvInput } from "../../Input/Input.js";
11
11
  const HvCalendarHeader = (props) => {
12
12
  const {
13
13
  id,
@@ -8,9 +8,9 @@ import { DEFAULT_LOCALE, isDate, getWeekdayNamesList, isRange } from "../utils.j
8
8
  import { HvCalendarCell } from "./CalendarCell.js";
9
9
  import { useClasses } from "./SingleCalendar.styles.js";
10
10
  import { staticClasses } from "./SingleCalendar.styles.js";
11
+ import { HvPanel } from "../../Panel/Panel.js";
11
12
  import { HvComposedNavigation } from "../CalendarNavigation/ComposedNavigation/ComposedNavigation.js";
12
13
  import { HvMonthSelector } from "../CalendarNavigation/MonthSelector/MonthSelector.js";
13
- import { HvPanel } from "../../Panel/Panel.js";
14
14
  import { HvTypography } from "../../Typography/Typography.js";
15
15
  const HvSingleCalendar = (props) => {
16
16
  const {
@@ -8,8 +8,8 @@ import { useClasses } from "./Carousel.styles.js";
8
8
  import { staticClasses } from "./Carousel.styles.js";
9
9
  import { HvCarouselControls } from "./CarouselControls.js";
10
10
  import { HvCarouselThumbnails } from "./CarouselThumbnails.js";
11
- import { HvContainer } from "../Container/Container.js";
12
11
  import { HvIconButton } from "../IconButton/IconButton.js";
12
+ import { HvContainer } from "../Container/Container.js";
13
13
  import { HvTypography } from "../Typography/Typography.js";
14
14
  import { HvButton } from "../Button/Button.js";
15
15
  const DEFAULT_LABELS = {
@@ -7,8 +7,8 @@ import { setId } from "../utils/setId.js";
7
7
  import { useClasses } from "./CheckBox.styles.js";
8
8
  import { staticClasses } from "./CheckBox.styles.js";
9
9
  import { HvBaseCheckBox } from "../BaseCheckBox/BaseCheckBox.js";
10
- import { isInvalid } from "../FormElement/utils.js";
11
10
  import { HvFormElement } from "../FormElement/FormElement.js";
11
+ import { isInvalid } from "../FormElement/utils.js";
12
12
  import { HvLabel } from "../FormElement/Label/Label.js";
13
13
  import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
14
14
  const HvCheckBox = forwardRef(
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { forwardRef, useRef, useEffect } from "react";
2
+ import { forwardRef, useRef, useMemo, useEffect } from "react";
3
3
  import { useForkRef } from "@mui/material/utils";
4
4
  import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
5
5
  import { DEFAULT_LOCALE, isDate } from "../Calendar/utils.js";
@@ -14,13 +14,13 @@ import { useClasses } from "./DatePicker.styles.js";
14
14
  import { staticClasses } from "./DatePicker.styles.js";
15
15
  import useVisibleDate from "./useVisibleDate.js";
16
16
  import { getDateLabel } from "./utils.js";
17
- import { HvCalendar } from "../Calendar/Calendar.js";
18
17
  import { HvFormElement } from "../FormElement/FormElement.js";
19
18
  import { HvBaseDropdown } from "../BaseDropdown/BaseDropdown.js";
20
- import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
19
+ import { HvCalendar } from "../Calendar/Calendar.js";
21
20
  import { isInvalid } from "../FormElement/utils.js";
22
21
  import { HvActionBar } from "../ActionBar/ActionBar.js";
23
22
  import { HvButton } from "../Button/Button.js";
23
+ import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
24
24
  const DEFAULT_LABELS = {
25
25
  /** Apply button label. */
26
26
  applyLabel: "Apply",
@@ -92,6 +92,11 @@ const HvDatePicker = forwardRef(
92
92
  const focusTarget = useRef(null);
93
93
  const { ref: refProp, ...otherDropdownProps } = dropdownProps;
94
94
  const dropdownForkedRef = useForkRef(ref, refProp);
95
+ const popperProps = useMemo(() => {
96
+ return {
97
+ modifiers: [{ name: "preventOverflow", enabled: escapeWithReference }]
98
+ };
99
+ }, [escapeWithReference]);
95
100
  useEffect(() => {
96
101
  setStartDate(rangeMode ? startValue : value, true);
97
102
  setEndDate(endValue, true);
@@ -290,11 +295,7 @@ const HvDatePicker = forwardRef(
290
295
  onContainerCreation: focusOnContainer,
291
296
  placeholder: dateString || placeholder || "",
292
297
  adornment: /* @__PURE__ */ jsx(HvIcon, { name: "Calendar", className: classes.icon }),
293
- popperProps: {
294
- modifiers: [
295
- { name: "preventOverflow", enabled: escapeWithReference }
296
- ]
297
- },
298
+ popperProps,
298
299
  "aria-haspopup": "dialog",
299
300
  "aria-label": ariaLabel,
300
301
  "aria-labelledby": [label && setId(elementId, "label"), ariaLabelledBy].join(" ").trim() || void 0,
@@ -12,12 +12,12 @@ import { setId } from "../utils/setId.js";
12
12
  import { useClasses } from "./Dropdown.styles.js";
13
13
  import { staticClasses } from "./Dropdown.styles.js";
14
14
  import { getSelectionLabel, getSelected } from "./utils.js";
15
- import { HvDropdownList } from "./List/List.js";
16
15
  import { HvFormElement } from "../FormElement/FormElement.js";
17
16
  import { HvBaseDropdown } from "../BaseDropdown/BaseDropdown.js";
18
- import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
17
+ import { HvDropdownList } from "./List/List.js";
19
18
  import { HvTypography } from "../Typography/Typography.js";
20
19
  import { isInvalid } from "../FormElement/utils.js";
20
+ import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
21
21
  const DEFAULT_LABELS = {
22
22
  /** Label for overwrite the default header behavior. */
23
23
  select: void 0,
@@ -6,10 +6,10 @@ import { CounterLabel } from "../../utils/CounterLabel.js";
6
6
  import { getSelected } from "../utils.js";
7
7
  import { useClasses } from "./List.styles.js";
8
8
  import { staticClasses } from "./List.styles.js";
9
- import { HvActionBar } from "../../ActionBar/ActionBar.js";
10
9
  import { HvList } from "../../List/List.js";
11
10
  import { HvInput } from "../../Input/Input.js";
12
11
  import { HvCheckBox } from "../../CheckBox/CheckBox.js";
12
+ import { HvActionBar } from "../../ActionBar/ActionBar.js";
13
13
  import { HvButton } from "../../Button/Button.js";
14
14
  const clone = (values) => values.map((value) => ({ ...value }));
15
15
  const cleanHidden = (lst) => lst.map((item) => ({ ...item, isHidden: false }));
@@ -3,9 +3,9 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
3
3
  import { useLabels } from "../hooks/useLabels.js";
4
4
  import { useClasses } from "./FileUploader.styles.js";
5
5
  import { staticClasses } from "./FileUploader.styles.js";
6
+ import { HvFormElement } from "../FormElement/FormElement.js";
6
7
  import { HvDropZone } from "./DropZone/DropZone.js";
7
8
  import { HvFileList } from "./FileList/FileList.js";
8
- import { HvFormElement } from "../FormElement/FormElement.js";
9
9
  const DEFAULT_LABELS = {
10
10
  removeFileButtonLabel: "Remove File"
11
11
  };
@@ -7,10 +7,10 @@ import { HvFilterGroupContext } from "../FilterGroupContext.js";
7
7
  import { useClasses } from "./FilterContent.styles.js";
8
8
  import { staticClasses } from "./FilterContent.styles.js";
9
9
  import { HvHeaderButton } from "./HeaderButton.js";
10
- import { HvFilterGroupLeftPanel } from "../LeftPanel/LeftPanel.js";
11
- import { HvFilterGroupRightPanel } from "../RightPanel/RightPanel.js";
12
10
  import { HvTypography } from "../../Typography/Typography.js";
13
11
  import { HvBaseDropdown } from "../../BaseDropdown/BaseDropdown.js";
12
+ import { HvFilterGroupLeftPanel } from "../LeftPanel/LeftPanel.js";
13
+ import { HvFilterGroupRightPanel } from "../RightPanel/RightPanel.js";
14
14
  import { HvActionBar } from "../../ActionBar/ActionBar.js";
15
15
  import { HvButton } from "../../Button/Button.js";
16
16
  import { HvFilterGroupCounter } from "../Counter/Counter.js";
@@ -9,8 +9,8 @@ import { setId } from "../utils/setId.js";
9
9
  import { useClasses } from "./FilterGroup.styles.js";
10
10
  import { staticClasses } from "./FilterGroup.styles.js";
11
11
  import { HvFilterGroupProvider } from "./FilterGroupContext.js";
12
- import { HvFilterGroupContent } from "./FilterContent/FilterContent.js";
13
12
  import { HvFormElement } from "../FormElement/FormElement.js";
13
+ import { HvFilterGroupContent } from "./FilterContent/FilterContent.js";
14
14
  import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
15
15
  const DEFAULT_LABELS = {
16
16
  /** Apply button label. */
@@ -5,11 +5,11 @@ import { HvIcon } from "../../icons.js";
5
5
  import { HvFilterGroupContext } from "../FilterGroupContext.js";
6
6
  import { useClasses } from "./LeftPanel.styles.js";
7
7
  import { staticClasses } from "./LeftPanel.styles.js";
8
- import { HvFilterGroupCounter } from "../Counter/Counter.js";
9
8
  import { HvPanel } from "../../Panel/Panel.js";
10
9
  import { HvListContainer } from "../../ListContainer/ListContainer.js";
11
- import { HvListItem } from "../../ListContainer/ListItem/ListItem.js";
12
10
  import { HvOverflowTooltip } from "../../OverflowTooltip/OverflowTooltip.js";
11
+ import { HvFilterGroupCounter } from "../Counter/Counter.js";
12
+ import { HvListItem } from "../../ListContainer/ListItem/ListItem.js";
13
13
  const HvFilterGroupLeftPanel = ({
14
14
  className,
15
15
  emptyElement,
@@ -18,10 +18,10 @@ import { useClasses } from "./Input.styles.js";
18
18
  import { staticClasses } from "./Input.styles.js";
19
19
  import { changeInputValue } from "./utils.js";
20
20
  import { HvAdornment } from "../FormElement/Adornment/Adornment.js";
21
- import { isValid, isInvalid } from "../FormElement/utils.js";
22
- import { HvBaseInput } from "../BaseInput/BaseInput.js";
23
21
  import { HvTooltip } from "../Tooltip/Tooltip.js";
22
+ import { isValid, isInvalid } from "../FormElement/utils.js";
24
23
  import { HvFormElement } from "../FormElement/FormElement.js";
24
+ import { HvBaseInput } from "../BaseInput/BaseInput.js";
25
25
  import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
26
26
  import { HvInfoMessage } from "../FormElement/InfoMessage/InfoMessage.js";
27
27
  const DEFAULT_LABELS = {
package/dist/List/List.js CHANGED
@@ -8,12 +8,12 @@ import { useClasses } from "./List.styles.js";
8
8
  import { staticClasses } from "./List.styles.js";
9
9
  import { useSelectableList } from "./useSelectableList.js";
10
10
  import { parseList } from "./utils.js";
11
+ import { HvListContainer } from "../ListContainer/ListContainer.js";
11
12
  import { HvCheckBox } from "../CheckBox/CheckBox.js";
12
13
  import { HvRadio } from "../Radio/Radio.js";
13
14
  import { HvOverflowTooltip } from "../OverflowTooltip/OverflowTooltip.js";
14
- import { HvListContainer } from "../ListContainer/ListContainer.js";
15
- import { HvListItem } from "../ListContainer/ListItem/ListItem.js";
16
15
  import { HvTypography } from "../Typography/Typography.js";
16
+ import { HvListItem } from "../ListContainer/ListItem/ListItem.js";
17
17
  const DEFAULT_LABELS = {
18
18
  /** The label used in the middle of the multi-selection count. */
19
19
  selectionConjunction: "/"
@@ -5,8 +5,8 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
5
5
  import { HvIcon } from "../icons.js";
6
6
  import { changeInputValue } from "../Input/utils.js";
7
7
  import { useClasses } from "./NumberInput.styles.js";
8
- import { HvAdornment } from "../FormElement/Adornment/Adornment.js";
9
8
  import { HvInput } from "../Input/Input.js";
9
+ import { HvAdornment } from "../FormElement/Adornment/Adornment.js";
10
10
  const HvNumberInput = forwardRef(function HvNumberInput2(props, ref) {
11
11
  const {
12
12
  classes: classesProp,
@@ -29,6 +29,7 @@ const Attribute = ({
29
29
  disabled,
30
30
  readOnly,
31
31
  status: isInvalid ? "invalid" : "valid",
32
+ style: { gridArea: "attribute" },
32
33
  statusMessage: labels.rule.attribute.exists,
33
34
  onChange: (selected) => {
34
35
  if (selected) {
@@ -31,6 +31,7 @@ const Operator = ({
31
31
  label: labels.rule.operator.label,
32
32
  placeholder: labels.rule.operator.placeholder,
33
33
  values,
34
+ style: { gridArea: "operator" },
34
35
  disabled: values.length === 0,
35
36
  readOnly,
36
37
  onChange: (selected) => {
@@ -9,7 +9,6 @@ import { Value } from "../Value/Value.js";
9
9
  import { Attribute } from "./Attribute.js";
10
10
  import { Operator } from "./Operator.js";
11
11
  import { useClasses } from "./Rule.styles.js";
12
- import { HvGrid } from "../../Grid/Grid.js";
13
12
  import { HvIconButton } from "../../IconButton/IconButton.js";
14
13
  const Rule = (props) => {
15
14
  const {
@@ -47,56 +46,49 @@ const Rule = (props) => {
47
46
  }
48
47
  return -1;
49
48
  }, [attribute, attributes, combinator, operators]);
50
- return /* @__PURE__ */ jsxs(
51
- HvGrid,
52
- {
53
- container: true,
54
- className: cx(classes.root, { [classes.isMdDown]: isMdDown }),
55
- spacing: 0,
56
- children: [
57
- /* @__PURE__ */ jsx(HvGrid, { item: true, xs: 12, md: 3, children: /* @__PURE__ */ jsx(
58
- Attribute,
59
- {
60
- attribute,
61
- id,
62
- disabled,
63
- isInvalid
64
- }
65
- ) }),
66
- attribute != null && availableOperators > 0 && /* @__PURE__ */ jsx(HvGrid, { item: true, xs: 12, md: 3, children: /* @__PURE__ */ jsx(
67
- Operator,
68
- {
69
- id,
70
- combinator,
71
- attribute,
72
- operator
73
- }
74
- ) }),
75
- attribute != null && (operator != null || availableOperators === 0) && /* @__PURE__ */ jsx(HvGrid, { item: true, xs: 12, md: true, children: /* @__PURE__ */ jsx(
76
- Value,
77
- {
78
- attribute,
79
- id,
80
- operator,
81
- value
82
- }
83
- ) }),
84
- /* @__PURE__ */ jsx(HvGrid, { item: true, className: classes.actionsContainer, children: /* @__PURE__ */ jsx(
85
- HvIconButton,
86
- {
87
- placement: "bottom",
88
- title: labels.rule.delete.tooltip,
89
- onClick: () => disableConfirmation ? dispatchAction({ type: "remove-node", id }) : askAction({
90
- actions: [{ type: "remove-node", id }],
91
- dialog: labels.rule.delete
92
- }),
93
- disabled: readOnly,
94
- children: /* @__PURE__ */ jsx(HvIcon, { name: "Delete" })
95
- }
96
- ) })
97
- ]
98
- }
99
- );
49
+ return /* @__PURE__ */ jsxs("div", { className: cx(classes.root, { [classes.isMdDown]: isMdDown }), children: [
50
+ /* @__PURE__ */ jsx(
51
+ Attribute,
52
+ {
53
+ attribute,
54
+ id,
55
+ disabled,
56
+ isInvalid
57
+ }
58
+ ),
59
+ attribute != null && availableOperators > 0 && /* @__PURE__ */ jsx(
60
+ Operator,
61
+ {
62
+ id,
63
+ combinator,
64
+ attribute,
65
+ operator
66
+ }
67
+ ),
68
+ attribute != null && (operator != null || availableOperators === 0) && /* @__PURE__ */ jsx("div", { style: { gridArea: "value" }, children: /* @__PURE__ */ jsx(
69
+ Value,
70
+ {
71
+ attribute,
72
+ id,
73
+ operator,
74
+ value
75
+ }
76
+ ) }),
77
+ /* @__PURE__ */ jsx(
78
+ HvIconButton,
79
+ {
80
+ placement: "bottom",
81
+ className: classes.actionsContainer,
82
+ title: labels.rule.delete.tooltip,
83
+ onClick: () => disableConfirmation ? dispatchAction({ type: "remove-node", id }) : askAction({
84
+ actions: [{ type: "remove-node", id }],
85
+ dialog: labels.rule.delete
86
+ }),
87
+ disabled: readOnly,
88
+ children: /* @__PURE__ */ jsx(HvIcon, { name: "Delete" })
89
+ }
90
+ )
91
+ ] });
100
92
  };
101
93
  export {
102
94
  Rule
@@ -6,8 +6,12 @@ const { useClasses } = createClasses("HvQueryBuilderRule", {
6
6
  position: "relative",
7
7
  marginTop: theme.space.xs,
8
8
  minHeight: 94,
9
- "&>div:not(:last-child)": {
10
- paddingRight: theme.space.md
9
+ display: "grid",
10
+ gridTemplateColumns: "1fr 1fr 2fr 32px",
11
+ gridTemplateAreas: '"attribute operator value actions"',
12
+ gap: theme.space.md,
13
+ "&:>*": {
14
+ minWidth: 0
11
15
  },
12
16
  // hide required * as all fields are required
13
17
  "& label>span[aria-hidden]": {
@@ -36,18 +40,16 @@ const { useClasses } = createClasses("HvQueryBuilderRule", {
36
40
  }
37
41
  },
38
42
  actionsContainer: {
39
- marginLeft: "auto",
40
- marginTop: "24px",
41
- "&>:not(:last-child)": {
42
- marginRight: theme.space.xs
43
- }
43
+ gridArea: "actions",
44
+ justifySelf: "end",
45
+ marginTop: "24px"
44
46
  },
45
47
  isMdDown: {
46
- "&>div:not(:last-child)": {
47
- paddingRight: 0
48
- },
49
- "&>div:not(:first-of-type)": {
50
- marginTop: theme.space.xs
48
+ gridTemplateColumns: "1fr",
49
+ gridTemplateAreas: '"attribute" "operator" "value" "actions"',
50
+ gap: theme.space.xs,
51
+ "& $actionsContainer": {
52
+ marginTop: 0
51
53
  }
52
54
  }
53
55
  });
@@ -4,10 +4,10 @@ import { HvIcon } from "../icons.js";
4
4
  import { useQueryBuilderContext } from "./Context.js";
5
5
  import { useClasses } from "./QueryBuilder.styles.js";
6
6
  import { Rule } from "./Rule/Rule.js";
7
- import { HvEmptyState } from "../EmptyState/EmptyState.js";
8
7
  import { HvButton } from "../Button/Button.js";
9
8
  import { HvMultiButton } from "../MultiButton/MultiButton.js";
10
9
  import { HvIconButton } from "../IconButton/IconButton.js";
10
+ import { HvEmptyState } from "../EmptyState/EmptyState.js";
11
11
  import { HvTypography } from "../Typography/Typography.js";
12
12
  const RuleGroup = ({
13
13
  level = 0,
@@ -8,9 +8,9 @@ import { useClasses } from "./Radio.styles.js";
8
8
  import { staticClasses } from "./Radio.styles.js";
9
9
  import { HvBaseRadio } from "../BaseRadio/BaseRadio.js";
10
10
  import { HvFormElement } from "../FormElement/FormElement.js";
11
+ import { isInvalid } from "../FormElement/utils.js";
11
12
  import { HvLabel } from "../FormElement/Label/Label.js";
12
13
  import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
13
- import { isInvalid } from "../FormElement/utils.js";
14
14
  const HvRadio = forwardRef(
15
15
  function HvRadio2(props, ref) {
16
16
  const {
@@ -40,7 +40,7 @@ const HvSection = forwardRef(
40
40
  }),
41
41
  ...others,
42
42
  children: [
43
- hasHeader && // eslint-disable-next-line jsx-a11y/click-events-have-key-events jsx-a11y/no-static-element-interactions
43
+ hasHeader && // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
44
44
  /* @__PURE__ */ jsxs(
45
45
  "div",
46
46
  {
@@ -9,9 +9,9 @@ import { multiSelectionEventHandler } from "../utils/multiSelectionEventHandler.
9
9
  import { setId } from "../utils/setId.js";
10
10
  import { useClasses } from "./SelectionList.styles.js";
11
11
  import { staticClasses } from "./SelectionList.styles.js";
12
+ import { HvFormElement } from "../FormElement/FormElement.js";
12
13
  import { HvLabel } from "../FormElement/Label/Label.js";
13
14
  import { HvInfoMessage } from "../FormElement/InfoMessage/InfoMessage.js";
14
- import { HvFormElement } from "../FormElement/FormElement.js";
15
15
  import { HvListContainer } from "../ListContainer/ListContainer.js";
16
16
  import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
17
17
  const getValueFromSelectedChildren = (children, multiple) => {
@@ -6,11 +6,11 @@ import { useUniqueId } from "../hooks/useUniqueId.js";
6
6
  import { setId } from "../utils/setId.js";
7
7
  import { useClasses } from "./Switch.styles.js";
8
8
  import { staticClasses } from "./Switch.styles.js";
9
- import { HvBaseSwitch } from "../BaseSwitch/BaseSwitch.js";
10
9
  import { HvFormElement } from "../FormElement/FormElement.js";
10
+ import { HvBaseSwitch } from "../BaseSwitch/BaseSwitch.js";
11
+ import { isInvalid } from "../FormElement/utils.js";
11
12
  import { HvLabel } from "../FormElement/Label/Label.js";
12
13
  import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
13
- import { isInvalid } from "../FormElement/utils.js";
14
14
  const HvSwitch = forwardRef(
15
15
  function HvSwitch2(props, ref) {
16
16
  const {
@@ -6,9 +6,9 @@ import { HvDateColumnCell } from "./DateColumnCell.js";
6
6
  import { HvDropdownColumnCell } from "./DropdownColumnCell.js";
7
7
  import { HvProgressColumnCell } from "./ProgressColumnCell.js";
8
8
  import { HvSwitchColumnCell } from "./SwitchColumnCell.js";
9
- import { HvTag } from "../../Tag/Tag.js";
10
9
  import { HvButton } from "../../Button/Button.js";
11
10
  import { HvOverflowTooltip } from "../../OverflowTooltip/OverflowTooltip.js";
11
+ import { HvTag } from "../../Tag/Tag.js";
12
12
  const EM_DASH = "—";
13
13
  const hvStringFallback = (value) => {
14
14
  return typeof value === "string" && value !== "" ? value : EM_DASH;
@@ -13,8 +13,8 @@ import { isKey } from "../utils/keyboardUtils.js";
13
13
  import { setId } from "../utils/setId.js";
14
14
  import { useClasses } from "./TagsInput.styles.js";
15
15
  import { staticClasses } from "./TagsInput.styles.js";
16
- import { HvCharCounter } from "../FormElement/CharCounter/CharCounter.js";
17
16
  import { HvFormElement } from "../FormElement/FormElement.js";
17
+ import { HvCharCounter } from "../FormElement/CharCounter/CharCounter.js";
18
18
  import { HvTag } from "../Tag/Tag.js";
19
19
  import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
20
20
  const HvTagsInput = forwardRef(
@@ -10,11 +10,11 @@ import { setId } from "../utils/setId.js";
10
10
  import { useClasses } from "./TextArea.styles.js";
11
11
  import { staticClasses } from "./TextArea.styles.js";
12
12
  import { HvFormElement } from "../FormElement/FormElement.js";
13
- import { HvCharCounter } from "../FormElement/CharCounter/CharCounter.js";
14
13
  import { HvBaseInput } from "../BaseInput/BaseInput.js";
14
+ import { isInvalid } from "../FormElement/utils.js";
15
+ import { HvCharCounter } from "../FormElement/CharCounter/CharCounter.js";
15
16
  import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
16
17
  import { HvInfoMessage } from "../FormElement/InfoMessage/InfoMessage.js";
17
- import { isInvalid } from "../FormElement/utils.js";
18
18
  const HvTextArea = forwardRef(function HvTextArea2(props, ref) {
19
19
  const {
20
20
  id,
@@ -1,6 +1,6 @@
1
- import { jsx, Fragment, jsxs } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useRef } from "react";
3
- import { useDateSegment } from "@react-aria/datepicker";
3
+ import { useDateSegment } from "react-aria/useDateField";
4
4
  const getDateValue = (date) => {
5
5
  if (!date) return "";
6
6
  const { hour, minute, second } = date;
@@ -9,45 +9,50 @@ const getDateValue = (date) => {
9
9
  const PlaceholderSegment = ({
10
10
  segment,
11
11
  state,
12
- placeholder
12
+ value
13
13
  }) => {
14
14
  const ref = useRef(null);
15
15
  const { segmentProps } = useDateSegment(segment, state, ref);
16
- return /* @__PURE__ */ jsx("div", { ref, ...segmentProps, children: (() => {
17
- if (segment.type === "literal") return segment.text;
18
- if (segment.isPlaceholder) return placeholder ?? segment.text;
19
- return segment.text.padStart(2, "0");
20
- })() });
16
+ if (segment.type === "literal" && segment.text === "⁦") return;
17
+ return /* @__PURE__ */ jsx("div", { ref, ...segmentProps, children: value });
21
18
  };
22
19
  const Placeholder = forwardRef(
23
20
  function Placeholder2(props, ref) {
24
21
  const { name, state, placeholders, onKeyDown, ...others } = props;
25
22
  const { value, segments } = state;
26
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
27
- "div",
28
- {
29
- ref,
30
- onKeyDown: (event) => {
31
- event.stopPropagation();
32
- onKeyDown?.(event);
33
- },
34
- ...others,
35
- children: [
36
- name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: getDateValue(value) }),
37
- segments.map((segment) => /* @__PURE__ */ jsx(
38
- PlaceholderSegment,
39
- {
40
- segment,
41
- state,
42
- placeholder: placeholders[segment.type]
43
- },
44
- segment.type
45
- ))
46
- ]
47
- }
48
- ) });
23
+ return (
24
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
25
+ /* @__PURE__ */ jsxs(
26
+ "div",
27
+ {
28
+ ref,
29
+ onKeyDown: (event) => {
30
+ event.stopPropagation();
31
+ onKeyDown?.(event);
32
+ },
33
+ ...others,
34
+ children: [
35
+ name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: getDateValue(value) }),
36
+ segments.map((segment, i) => /* @__PURE__ */ jsx(
37
+ PlaceholderSegment,
38
+ {
39
+ segment,
40
+ state,
41
+ value: renderSegment(segment, placeholders[segment.type])
42
+ },
43
+ segment.type === "literal" ? `literal-${i}` : segment.type
44
+ ))
45
+ ]
46
+ }
47
+ )
48
+ );
49
49
  }
50
50
  );
51
+ function renderSegment(segment, placeholder) {
52
+ if (segment.type === "literal") return segment.text;
53
+ if (segment.isPlaceholder) return placeholder ?? segment.text;
54
+ return segment.text.padStart(2, "0");
55
+ }
51
56
  export {
52
57
  Placeholder
53
58
  };
@@ -1,9 +1,9 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { forwardRef, useRef, useState, useMemo } from "react";
2
+ import { forwardRef, useRef, useMemo, useState } from "react";
3
+ import { useTimeField } from "react-aria/useTimeField";
4
+ import { useTimeFieldState } from "react-stately/useTimeFieldState";
3
5
  import { Time } from "@internationalized/date";
4
- import { useForkRef } from "@mui/material/utils";
5
- import { useTimeField } from "@react-aria/datepicker";
6
- import { useTimeFieldState } from "@react-stately/datepicker";
6
+ import useForkRef from "@mui/utils/useForkRef";
7
7
  import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
8
8
  import { DEFAULT_LOCALE } from "../Calendar/utils.js";
9
9
  import { HvLabelContainer } from "../FormElement/LabelContainer.js";
@@ -14,9 +14,9 @@ import { setId } from "../utils/setId.js";
14
14
  import { Placeholder } from "./Placeholder.js";
15
15
  import { useClasses } from "./TimePicker.styles.js";
16
16
  import { staticClasses } from "./TimePicker.styles.js";
17
- import { Unit } from "./Unit/Unit.js";
18
17
  import { HvFormElement } from "../FormElement/FormElement.js";
19
18
  import { HvBaseDropdown } from "../BaseDropdown/BaseDropdown.js";
19
+ import { Unit } from "./Unit/Unit.js";
20
20
  import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
21
21
  const toTime = (value) => {
22
22
  if (!value) return value;
@@ -64,8 +64,9 @@ const HvTimePicker = forwardRef(
64
64
  const timeFieldRef = useRef(null);
65
65
  const { ref: refProp, ...otherDropdownProps } = dropdownProps;
66
66
  const dropdownForkedRef = useForkRef(ref, refProp);
67
+ const valueState = useMemo(() => toTime(valueProp), [valueProp]);
67
68
  const stateProps = {
68
- value: toTime(valueProp),
69
+ value: valueState,
69
70
  defaultValue: toTime(defaultValueProp),
70
71
  label,
71
72
  locale,
@@ -92,6 +93,11 @@ const HvTimePicker = forwardRef(
92
93
  state,
93
94
  timeFieldRef
94
95
  );
96
+ const popperProps = useMemo(() => {
97
+ return {
98
+ modifiers: [{ name: "preventOverflow", enabled: escapeWithReference }]
99
+ };
100
+ }, [escapeWithReference]);
95
101
  const [open, setOpen] = useState(false);
96
102
  const [validationMessage] = useControlled(statusMessage, "Required");
97
103
  const [validationState] = useControlled(status, "standBy");
@@ -176,13 +182,9 @@ const HvTimePicker = forwardRef(
176
182
  "aria-invalid": isStateInvalid ? true : void 0,
177
183
  "aria-errormessage": errorMessageId,
178
184
  disablePortal,
179
- popperProps: {
180
- modifiers: [
181
- { name: "preventOverflow", enabled: escapeWithReference }
182
- ]
183
- },
185
+ popperProps,
184
186
  ...otherDropdownProps,
185
- children: /* @__PURE__ */ jsx("div", { ref: timeFieldRef, className: classes.timePopperContainer, children: state.segments.map((segment) => /* @__PURE__ */ jsx(
187
+ children: /* @__PURE__ */ jsx("div", { ref: timeFieldRef, className: classes.timePopperContainer, children: state.segments.map((segment, i) => /* @__PURE__ */ jsx(
186
188
  Unit,
187
189
  {
188
190
  state,
@@ -194,7 +196,7 @@ const HvTimePicker = forwardRef(
194
196
  state.setSegment(segment.type, Number(val));
195
197
  }
196
198
  },
197
- segment.type
199
+ segment.type === "literal" ? `literal-${i}` : segment.type
198
200
  )) })
199
201
  }
200
202
  ),
@@ -4,9 +4,9 @@ import { HvIcon } from "../../icons.js";
4
4
  import { useClasses } from "./NavigationSlider.styles.js";
5
5
  import { staticClasses } from "./NavigationSlider.styles.js";
6
6
  import { HvListContainer } from "../../ListContainer/ListContainer.js";
7
- import { HvListItem } from "../../ListContainer/ListItem/ListItem.js";
8
7
  import { HvOverflowTooltip } from "../../OverflowTooltip/OverflowTooltip.js";
9
8
  import { HvButton } from "../../Button/Button.js";
9
+ import { HvListItem } from "../../ListContainer/ListItem/ListItem.js";
10
10
  const HvVerticalNavigationSlider = (props) => {
11
11
  const {
12
12
  className,
@@ -6,8 +6,8 @@ import { theme } from "@hitachivantara/uikit-styles";
6
6
  import { HvIcon } from "../icons.js";
7
7
  import { iconVariant } from "./iconVariant.js";
8
8
  import { HvActionsGeneric } from "../ActionsGeneric/ActionsGeneric.js";
9
- import { HvStatusIcon } from "../StatusIcon/StatusIcon.js";
10
9
  import { HvButton } from "../Button/Button.js";
10
+ import { HvStatusIcon } from "../StatusIcon/StatusIcon.js";
11
11
  const { useClasses } = createClasses("HvCallout", {
12
12
  root: {
13
13
  position: "relative",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-core",
3
- "version": "6.8.0",
3
+ "version": "6.8.2",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "author": "Hitachi Vantara UI Kit Team",
@@ -39,8 +39,6 @@
39
39
  "@internationalized/date": "^3.2.0",
40
40
  "@mui/base": "7.0.0-beta.4",
41
41
  "@popperjs/core": "^2.11.8",
42
- "@react-aria/datepicker": "^3.9.0",
43
- "@react-stately/datepicker": "^3.9.0",
44
42
  "@types/react-table": "^7.7.18",
45
43
  "@uiw/react-color-hue": "^2.9.2",
46
44
  "@uiw/react-color-saturation": "^2.9.2",
@@ -49,8 +47,10 @@
49
47
  "notistack": "^3.0.2",
50
48
  "rc-slider": "^10.5.0",
51
49
  "rc-tooltip": "~6.3.0",
50
+ "react-aria": "^3.48.0",
52
51
  "react-popper": "^2.3.0",
53
52
  "react-resize-detector": "^12.3.0",
53
+ "react-stately": "^3.46.0",
54
54
  "react-table": "^7.8.0",
55
55
  "react-window": "^1.8.10"
56
56
  },
@@ -61,7 +61,7 @@
61
61
  "access": "public",
62
62
  "directory": "package"
63
63
  },
64
- "gitHead": "f79885f320f5cdf5b438ef8b2e866965c9626ce7",
64
+ "gitHead": "333e132a9823018d508ebbe71c81d0b467f9008d",
65
65
  "exports": {
66
66
  ".": {
67
67
  "types": "./dist/index.d.ts",