@hitachivantara/uikit-react-core 6.10.0 → 6.11.0

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/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2019 Hitachi Vantara Corporation
189
+ Copyright 2026 Pentaho Canada Inc.
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
@@ -2,8 +2,21 @@ import { theme } from "@hitachivantara/uikit-styles";
2
2
  import { createClasses } from "@hitachivantara/uikit-react-utils";
3
3
  //#region src/VerticalNavigation/NavigationPopup/NavigationPopup.styles.tsx
4
4
  var { staticClasses, useClasses } = createClasses("HvVerticalNavigationPopup", {
5
- popup: {},
6
- container: { marginLeft: theme.spacing("xs") },
5
+ popup: { "--hv-popup-nav-bg": theme.colors.bgContainer },
6
+ wrapper: {
7
+ position: "relative",
8
+ paddingLeft: 8
9
+ },
10
+ arrow: {
11
+ position: "absolute",
12
+ left: 0,
13
+ width: 0,
14
+ height: 0,
15
+ borderTop: `${theme.space.xs} solid transparent`,
16
+ borderBottom: `${theme.space.xs} solid transparent`,
17
+ borderRight: `${theme.space.xs} solid var(--hv-popup-nav-bg)`
18
+ },
19
+ container: {},
7
20
  popper: { zIndex: theme.zIndices.popover }
8
21
  });
9
22
  //#endregion
@@ -1,31 +1,46 @@
1
1
  import { getContainerElement } from "../../utils/document.js";
2
2
  import { HvVerticalNavigation } from "../VerticalNavigation.js";
3
3
  import { useClasses } from "./NavigationPopup.styles.js";
4
- import { useTheme } from "@hitachivantara/uikit-react-utils";
5
- import { jsx } from "react/jsx-runtime";
4
+ import { useDefaultProps, useTheme } from "@hitachivantara/uikit-react-utils";
5
+ import { useMemo, useState } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
6
7
  import ClickAwayListener from "@mui/material/ClickAwayListener";
7
8
  import Popper from "@mui/material/Popper";
8
9
  //#region src/VerticalNavigation/NavigationPopup/NavigationPopupContainer.tsx
9
- var NavigationPopupContainer = ({ anchorEl, onClose, children, classes: classesProp, className, ...others }) => {
10
+ var NavigationPopupContainer = (props) => {
11
+ const { anchorEl, onClose, children, classes: classesProp, className, ...others } = useDefaultProps("HvVerticalNavigationPopup", props);
10
12
  const { classes, cx } = useClasses(classesProp);
11
13
  const { rootId } = useTheme();
14
+ const [arrowRef, setArrowRef] = useState(null);
15
+ const modifiers = useMemo(() => [{
16
+ name: "arrow",
17
+ enabled: Boolean(arrowRef),
18
+ options: { element: arrowRef }
19
+ }], [arrowRef]);
12
20
  const handleClickAway = () => onClose?.();
13
21
  return /* @__PURE__ */ jsx(Popper, {
14
22
  open: true,
15
23
  anchorEl,
16
24
  placement: "right-start",
17
25
  container: getContainerElement(rootId),
26
+ modifiers,
18
27
  className: cx(classes.popper, classes.popup, className),
19
28
  ...others,
20
29
  children: /* @__PURE__ */ jsx(ClickAwayListener, {
21
30
  onClickAway: handleClickAway,
22
- children: /* @__PURE__ */ jsx("div", {
23
- className: classes.container,
24
- children: /* @__PURE__ */ jsx(HvVerticalNavigation, {
25
- open: true,
26
- useIcons: true,
27
- children
28
- })
31
+ children: /* @__PURE__ */ jsxs("div", {
32
+ className: classes.wrapper,
33
+ children: [/* @__PURE__ */ jsx("div", {
34
+ ref: setArrowRef,
35
+ className: classes.arrow
36
+ }), /* @__PURE__ */ jsx("div", {
37
+ className: classes.container,
38
+ children: /* @__PURE__ */ jsx(HvVerticalNavigation, {
39
+ open: true,
40
+ useIcons: true,
41
+ children
42
+ })
43
+ })]
29
44
  })
30
45
  })
31
46
  });
@@ -4,6 +4,7 @@ import { HvIcon } from "../../icons.js";
4
4
  import { HvTooltip } from "../../Tooltip/Tooltip.js";
5
5
  import { HvOverflowTooltip } from "../../OverflowTooltip/OverflowTooltip.js";
6
6
  import { HvAvatar } from "../../Avatar/Avatar.js";
7
+ import { HvIconContainer } from "../../IconContainer/IconContainer.js";
7
8
  import { DescendantProvider, useDescendant } from "../../TreeView/internals/DescendantProvider.js";
8
9
  import { VerticalNavigationContext } from "../VerticalNavigationContext.js";
9
10
  import { TreeViewControlContext, TreeViewStateContext } from "./TreeViewContext.js";
@@ -179,13 +180,13 @@ var HvVerticalNavigationTreeViewItem = forwardRef(function HvVerticalNavigationT
179
180
  selectable,
180
181
  isOpen
181
182
  ]);
183
+ const levelPadding = (useIcons || !isOpen ? 0 : 10) + level * (collapsible ? 16 : 10);
182
184
  const renderedContent = useMemo(() => {
183
185
  const buttonLinkProps = {
184
186
  href,
185
187
  target
186
188
  };
187
- const hasChildren = !!children;
188
- const showTooltip = !hasChildren && !isOpen && !disableTooltip;
189
+ const showTooltip = !!!children && !isOpen && !disableTooltip;
189
190
  const isLink = href !== void 0 && !disabled;
190
191
  return /* @__PURE__ */ jsx(HvTooltip, {
191
192
  placement: "right",
@@ -202,7 +203,7 @@ var HvVerticalNavigationTreeViewItem = forwardRef(function HvVerticalNavigationT
202
203
  disabled,
203
204
  onClick: handleClick,
204
205
  onMouseDown: handleMouseDown,
205
- style: { paddingLeft: (useIcons || !isOpen ? 0 : 10) + level * (collapsible ? 16 : 10) },
206
+ style: { paddingLeft: `var(--hv-content-padding, ${levelPadding}px)` },
206
207
  role: isLink ? void 0 : "button",
207
208
  ...treeviewMode ? {
208
209
  tabIndex: -1,
@@ -216,19 +217,15 @@ var HvVerticalNavigationTreeViewItem = forwardRef(function HvVerticalNavigationT
216
217
  "aria-label": payload?.label
217
218
  },
218
219
  children: [
219
- /* @__PURE__ */ jsxs("div", {
220
+ /* @__PURE__ */ jsx("div", {
220
221
  className: classes.icon,
221
222
  style: mergeStyles(void 0, { "--icon-margin-left": hasAnyChildWithData ? "auto" : "unset" }),
222
- children: [!icon && useIcons ? /* @__PURE__ */ jsx(HvAvatar, {
223
+ children: !icon && useIcons ? /* @__PURE__ */ jsx(HvAvatar, {
223
224
  variant: "square",
224
225
  size: "xs",
225
226
  backgroundColor: "textSubtle",
226
227
  children: payload?.label?.slice(0, 1)
227
- }) : useIcons && icon, hasChildren && !isOpen ? /* @__PURE__ */ jsx(HvIcon, {
228
- name: "Forwards",
229
- size: "xs",
230
- compact: true
231
- }) : hasAnyChildWithData && !isOpen && /* @__PURE__ */ jsx("div", {})]
228
+ }) : useIcons && /* @__PURE__ */ jsx(HvIconContainer, { children: icon })
232
229
  }),
233
230
  isOpen && /* @__PURE__ */ jsx("div", {
234
231
  className: cx(classes.label, {
@@ -240,7 +237,8 @@ var HvVerticalNavigationTreeViewItem = forwardRef(function HvVerticalNavigationT
240
237
  isOpen && expandable && /* @__PURE__ */ jsx(HvIcon, {
241
238
  name: "CaretDown",
242
239
  size: "xs",
243
- rotate: expanded
240
+ rotate: expanded,
241
+ style: { marginLeft: "auto" }
244
242
  })
245
243
  ]
246
244
  })
@@ -265,8 +263,7 @@ var HvVerticalNavigationTreeViewItem = forwardRef(function HvVerticalNavigationT
265
263
  handleClick,
266
264
  handleMouseDown,
267
265
  useIcons,
268
- level,
269
- collapsible,
266
+ levelPadding,
270
267
  treeviewMode,
271
268
  handleFocus,
272
269
  selectable,
@@ -280,14 +277,18 @@ var HvVerticalNavigationTreeViewItem = forwardRef(function HvVerticalNavigationT
280
277
  icon,
281
278
  hasAnyChildWithData
282
279
  ]);
283
- const renderedChildren = useMemo(() => children && /* @__PURE__ */ jsx("ul", {
284
- id: groupId,
285
- className: classes.group,
286
- role: treeviewMode ? "group" : void 0,
287
- children
280
+ const renderedChildren = useMemo(() => children && /* @__PURE__ */ jsx("div", {
281
+ className: classes.groupWrapper,
282
+ children: /* @__PURE__ */ jsx("ul", {
283
+ id: groupId,
284
+ className: classes.group,
285
+ role: treeviewMode ? "group" : void 0,
286
+ children
287
+ })
288
288
  }), [
289
289
  children,
290
290
  classes?.group,
291
+ classes?.groupWrapper,
291
292
  groupId,
292
293
  treeviewMode
293
294
  ]);
@@ -314,6 +315,7 @@ var HvVerticalNavigationTreeViewItem = forwardRef(function HvVerticalNavigationT
314
315
  "aria-disabled": disabled ? true : void 0
315
316
  },
316
317
  ...others,
318
+ style: { "--hv-nav-item-padding": `var(--hv-content-padding, ${levelPadding}px)` },
317
319
  children: [renderedContent, isOpen && /* @__PURE__ */ jsx(DescendantProvider, {
318
320
  id: nodeId,
319
321
  level: level + 1,
@@ -12,9 +12,14 @@ var { staticClasses, useClasses } = createClasses("HvVerticalNavigationTreeViewI
12
12
  node: {
13
13
  listStyle: "none",
14
14
  minHeight: "32px",
15
- "&:not(:last-child)": { marginBottom: "8px" },
16
- "&$collapsed": { "&>$group": { display: "none" } },
17
- "&$expanded": { "&>$group": { display: "block" } },
15
+ "&:not(:last-child)": { marginBottom: theme.space.xs },
16
+ "&$collapsed": { "&>$groupWrapper": {
17
+ gridTemplateRows: "0fr",
18
+ paddingTop: 0,
19
+ visibility: "hidden",
20
+ transition: "grid-template-rows 250ms ease, padding-top 250ms ease, visibility 0s 250ms"
21
+ } },
22
+ "&$expanded": { "&>$groupWrapper": { gridTemplateRows: "1fr" } },
18
23
  "&$link": { textDecoration: "none" },
19
24
  "&$hide": { display: "none" }
20
25
  },
@@ -28,7 +33,11 @@ var { staticClasses, useClasses } = createClasses("HvVerticalNavigationTreeViewI
28
33
  paddingRight: theme.space.xs,
29
34
  "&$minimized": {
30
35
  justifyContent: "center",
31
- paddingRight: 0
36
+ paddingRight: 0,
37
+ "& $icon": {
38
+ marginRight: 0,
39
+ width: 32
40
+ }
32
41
  },
33
42
  "$expandable>&": { fontWeight: 600 },
34
43
  "$selected>&": { ...selected },
@@ -51,9 +60,18 @@ var { staticClasses, useClasses } = createClasses("HvVerticalNavigationTreeViewI
51
60
  }
52
61
  },
53
62
  link: {},
63
+ groupWrapper: {
64
+ display: "grid",
65
+ gridTemplateRows: "1fr",
66
+ overflow: "hidden",
67
+ paddingTop: theme.space.xs,
68
+ transition: "grid-template-rows 250ms ease, padding-top 250ms ease, visibility 0s",
69
+ visibility: "visible"
70
+ },
54
71
  group: {
55
- margin: "8px 0 0 0",
56
- padding: 0
72
+ padding: 0,
73
+ minHeight: 0,
74
+ overflow: "hidden"
57
75
  },
58
76
  disabled: {},
59
77
  expandable: { fontWeight: 600 },
@@ -69,15 +87,14 @@ var { staticClasses, useClasses } = createClasses("HvVerticalNavigationTreeViewI
69
87
  label: {
70
88
  display: "flex",
71
89
  flexGrow: 1,
72
- maxWidth: "100%"
73
- },
74
- labelIcon: { maxWidth: "calc(100% - 32px)" },
75
- labelExpandable: {
76
- maxWidth: "calc(100% - 32px)",
77
- "&$labelIcon": { maxWidth: "calc(100% - 64px)" }
90
+ maxWidth: "100%",
91
+ gap: theme.space.xs
78
92
  },
93
+ labelIcon: {},
94
+ labelExpandable: {},
79
95
  icon: {
80
96
  display: "flex",
97
+ marginRight: theme.space.xs,
81
98
  alignItems: "center",
82
99
  "> div:first-of-type": { marginLeft: "var(--icon-margin-left)" },
83
100
  "> div:nth-of-type(2)": {
@@ -7,23 +7,23 @@ var { staticClasses, useClasses } = createClasses("HvVerticalNavigation", {
7
7
  flexDirection: "column",
8
8
  justifyContent: "flex-start",
9
9
  width: "220px",
10
+ overflow: "hidden",
11
+ transition: "width 300ms ease",
12
+ "@media (prefers-reduced-motion: reduce)": { transition: "none" },
10
13
  backgroundColor: theme.colors.bgContainer,
11
14
  boxShadow: theme.colors.shadow,
12
15
  clipPath: "inset(0px -12px 0px 0px)",
13
16
  "& > :only-child": { padding: theme.space.sm },
14
- "& > :not(nav:first-of-type)": {
17
+ "& > :first-child": { padding: theme.space.sm },
18
+ "& > * + *": {
15
19
  borderTop: `3px solid ${theme.colors.borderSubtle}`,
16
- padding: theme.spacing("xs", "sm", "sm", "sm")
17
- },
18
- "& > :first-of-type:not(:last-child)": {
19
- borderTop: "none",
20
- padding: theme.spacing("sm", "sm", "xs", "sm")
20
+ padding: theme.space.sm
21
21
  }
22
22
  },
23
23
  collapsed: {
24
- width: "fit-content",
25
- "& > :first-of-type:not(:last-child)": { padding: theme.spacing("sm", "xs", "xs", "xs") },
26
- "& > :not(nav:first-of-type)": { padding: theme.spacing("xs", "xs", "sm", "xs") }
24
+ width: `calc(${theme.space.sm} * 2 + 32px)`,
25
+ "& > :first-child": { padding: theme.spacing("sm", "sm") },
26
+ "& > * + *": { padding: theme.spacing("sm", "sm") }
27
27
  },
28
28
  slider: { "& > div:first-of-type": { borderBottom: `3px solid ${theme.colors.borderSubtle}` } },
29
29
  childData: {}
package/dist/index.d.ts CHANGED
@@ -7755,6 +7755,7 @@ export declare const treeViewItemClasses: {
7755
7755
  node: string;
7756
7756
  content: string;
7757
7757
  link: string;
7758
+ groupWrapper: string;
7758
7759
  group: string;
7759
7760
  disabled: string;
7760
7761
  expandable: string;
@@ -8295,11 +8296,12 @@ declare const useClasses_131: (classesProp?: Partial<Record<"root", string>>, ad
8295
8296
  readonly cx: (...args: any) => string;
8296
8297
  };
8297
8298
 
8298
- declare const useClasses_132: (classesProp?: Partial<Record<"hide" | "content" | "label" | "link" | "expanded" | "icon" | "disabled" | "group" | "unselectable" | "selected" | "selectable" | "focused" | "labelIcon" | "expandable" | "collapsed" | "minimized" | "node" | "unselected" | "labelExpandable", string>>, addStatic?: boolean) => {
8299
+ declare const useClasses_132: (classesProp?: Partial<Record<"hide" | "content" | "label" | "link" | "expanded" | "icon" | "disabled" | "group" | "unselectable" | "selected" | "selectable" | "focused" | "labelIcon" | "expandable" | "collapsed" | "minimized" | "node" | "groupWrapper" | "unselected" | "labelExpandable", string>>, addStatic?: boolean) => {
8299
8300
  readonly classes: {
8300
8301
  node: string;
8301
8302
  content: string;
8302
8303
  link: string;
8304
+ groupWrapper: string;
8303
8305
  group: string;
8304
8306
  disabled: string;
8305
8307
  expandable: string;
@@ -500,20 +500,55 @@ var pentaho$1 = mergeTheme(pentaho, {
500
500
  }
501
501
  }
502
502
  } },
503
- HvVerticalNavigation: { classes: {
504
- root: {
505
- width: 280,
506
- color: theme.colors.textLight,
507
- backgroundColor: slate[900],
508
- boxShadow: `inset -1px 0 0 0 ${slate[500]}`,
509
- "& > :not(nav:first-of-type)": { borderTop: `1px solid ${slate[500]}` },
510
- "& > :only-child": {
503
+ HvVerticalNavigation: {
504
+ "data-theme": "pentahoPlus",
505
+ "data-color-mode": "light",
506
+ classes: {
507
+ root: {
508
+ colorScheme: "light",
511
509
  padding: theme.space.sm,
512
- "& .HvVerticalNavigationSlider-listContainer": { padding: 0 }
510
+ paddingTop: 32,
511
+ width: 280,
512
+ color: theme.colors.textLight,
513
+ backgroundColor: `var(--hv-popup-nav-bg, ${slate[900]})`,
514
+ boxShadow: `inset -1px 0 0 0 ${slate[500]}`,
515
+ "& > * + *": {
516
+ padding: 0,
517
+ paddingTop: theme.space.sm,
518
+ borderTop: `1px solid ${theme.alpha(slate[300], .3)}`
519
+ },
520
+ "& > * + div": { borderTop: `1px solid ${slate[500]}` },
521
+ "& > :only-child": {
522
+ padding: theme.space.sm,
523
+ "& .HvVerticalNavigationSlider-listContainer": { padding: 0 }
524
+ },
525
+ "& > :first-child": {
526
+ padding: 0,
527
+ paddingBottom: theme.space.sm
528
+ },
529
+ ".HvVerticalNavigationPopup-wrapper:has(&)": { "--hv-popup-nav-bg": slate[800] },
530
+ ".HvVerticalNavigationPopup-container:has(> &)": {
531
+ borderRadius: theme.radii.round,
532
+ overflow: "hidden"
533
+ },
534
+ ".HvVerticalNavigationPopup-container &": {
535
+ padding: theme.space.sm,
536
+ paddingBottom: 0
537
+ }
538
+ },
539
+ slider: { "& > div:first-of-type": { borderBottom: `1px solid ${slate[500]}` } },
540
+ collapsed: {
541
+ "& > :first-child": {
542
+ padding: 0,
543
+ paddingBottom: theme.space.sm
544
+ },
545
+ "& > * + *": {
546
+ padding: 0,
547
+ paddingTop: theme.space.sm
548
+ }
513
549
  }
514
- },
515
- slider: { "& > div:first-of-type": { borderBottom: `1px solid ${slate[500]}` } }
516
- } },
550
+ }
551
+ },
517
552
  HvVerticalNavigationAction: { classes: { action: {
518
553
  borderRadius: theme.radii.round,
519
554
  "&:hover, &:focus": { backgroundColor: slate[700] }
@@ -543,6 +578,7 @@ var pentaho$1 = mergeTheme(pentaho, {
543
578
  content: {
544
579
  borderLeft: "unset",
545
580
  borderRadius: theme.radii.round,
581
+ ".HvVerticalNavigationTreeViewItem-expandable>&": { fontWeight: theme.fontWeights.normal },
546
582
  ".HvVerticalNavigationTreeViewItem-selected>&": {
547
583
  background: blue[800],
548
584
  borderLeft: "unset"
@@ -554,7 +590,14 @@ var pentaho$1 = mergeTheme(pentaho, {
554
590
  "& .HvVerticalNavigationTreeViewItem-label": { color: neutral[500] },
555
591
  "& .HvVerticalNavigationTreeViewItem-content": { background: neutral[800] }
556
592
  },
557
- icon: { "& .HvAvatar-root": { borderRadius: theme.radii.round } }
593
+ expandable: { fontWeight: theme.fontWeights.normal },
594
+ icon: { "& .HvAvatar-root": { borderRadius: theme.radii.round } },
595
+ group: {
596
+ "--hv-content-padding": "0px",
597
+ borderLeft: `1px solid ${theme.alpha("border", .3)}`,
598
+ marginLeft: "calc(var(--hv-nav-item-padding, 0px) + 16px)",
599
+ paddingLeft: theme.space.sm
600
+ }
558
601
  } },
559
602
  HvCard: { classes: {
560
603
  root: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-core",
3
- "version": "6.10.0",
3
+ "version": "6.11.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "author": "UI Kit Team",
@@ -40,9 +40,9 @@
40
40
  "dependencies": {
41
41
  "@emotion/cache": "^11.11.0",
42
42
  "@emotion/serialize": "^1.1.2",
43
- "@hitachivantara/uikit-react-shared": "^6.0.8",
44
- "@hitachivantara/uikit-react-utils": "^6.2.6",
45
- "@hitachivantara/uikit-styles": "^6.2.1",
43
+ "@hitachivantara/uikit-react-shared": "^6.0.9",
44
+ "@hitachivantara/uikit-react-utils": "^6.2.7",
45
+ "@hitachivantara/uikit-styles": "^6.2.2",
46
46
  "@internationalized/date": "^3.2.0",
47
47
  "@mui/base": "7.0.0-beta.4",
48
48
  "@popperjs/core": "^2.11.8",
@@ -82,5 +82,5 @@
82
82
  "publishConfig": {
83
83
  "access": "public"
84
84
  },
85
- "gitHead": "84643326d359781e4457c8a882c42c5a6d321744"
85
+ "gitHead": "a119469b0025a2693e3bb9a36f036658292cf645"
86
86
  }