@carbon-labs/react-ui-shell 0.68.0 → 0.70.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/README.md CHANGED
@@ -41,6 +41,7 @@ components are provided by `@carbon-labs/react-ui-shell`:
41
41
  - `SideNavMenu`
42
42
  - `SideNavMenuItem`
43
43
  - `SideNavSlot`
44
+ - `SideNavTitle`
44
45
  - `TrialCountdown`
45
46
 
46
47
  ```jsx
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { ArrowLeft, ChevronRight, ChevronDown } from '@carbon/icons-react';
8
+ import { ChevronRight, ChevronDown, ArrowLeft } from '@carbon/icons-react';
9
9
  import { SideNavIcon, Layer, Button } from '@carbon/react';
10
10
  import { breakpoints } from '../node_modules/@carbon/layout/es/index.js';
11
11
  import cx from 'classnames';
@@ -332,7 +332,7 @@ const SideNavMenu = /*#__PURE__*/React__default.forwardRef(function SideNavMenu(
332
332
  ref: menuRef,
333
333
  type: "button",
334
334
  tabIndex: isTreeview ? -1 : 0
335
- }, IconElement && /*#__PURE__*/React__default.createElement(SideNavIcon, null, /*#__PURE__*/React__default.createElement(IconElement, null)), !sideNavExpanded && /*#__PURE__*/React__default.createElement("div", {
335
+ }, IconElement && /*#__PURE__*/React__default.createElement(SideNavIcon, null, /*#__PURE__*/React__default.createElement(IconElement, null)), !sideNavExpanded && navType == SIDE_NAV_TYPE.PANEL && /*#__PURE__*/React__default.createElement("div", {
336
336
  className: `${prefix}--side-nav--panel-submenu-caret-container`
337
337
  }, /*#__PURE__*/React__default.createElement("div", {
338
338
  className: `${prefix}--side-nav--panel-submenu-caret`
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ export interface SideNavTitleProps {
9
+ /**
10
+ * Provide the contents of the SideNavTitle.
11
+ */
12
+ children?: React.ReactNode;
13
+ /**
14
+ * Provide an optional class to be applied to the containing node
15
+ */
16
+ className?: string;
17
+ }
18
+ export declare const SideNavTitle: React.FC<SideNavTitleProps>;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import cx from 'classnames';
9
+ import PropTypes from 'prop-types';
10
+ import React__default from 'react';
11
+ import { usePrefix } from '../internal/usePrefix.js';
12
+ import { SideNavDivider } from '@carbon/react';
13
+
14
+ var _SideNavDivider;
15
+ const SideNavTitle = ({
16
+ children,
17
+ className: customClassName
18
+ }) => {
19
+ const prefix = usePrefix();
20
+ const className = cx(`${prefix}--side-nav__title`, customClassName);
21
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("li", {
22
+ className: className
23
+ }, children), _SideNavDivider || (_SideNavDivider = /*#__PURE__*/React__default.createElement(SideNavDivider, null)));
24
+ };
25
+ SideNavTitle.propTypes = {
26
+ /**
27
+ * Provide the contents of the SideNavTitle.
28
+ */
29
+ children: PropTypes.node,
30
+ /**
31
+ * Provide an optional class to be applied to the containing node
32
+ */
33
+ className: PropTypes.string
34
+ };
35
+
36
+ export { SideNavTitle };
package/es/index.d.ts CHANGED
@@ -19,3 +19,4 @@ export { HeaderDivider } from './components/HeaderDivider';
19
19
  export { TrialCountdown } from './components/TrialCountdown';
20
20
  export * as Profile from './components/Profile';
21
21
  export { SideNavSlot } from './components/SideNavSlot';
22
+ export { SideNavTitle } from './components/SideNavTitle';
package/es/index.js CHANGED
@@ -19,3 +19,4 @@ export { TrialCountdown } from './components/TrialCountdown.js';
19
19
  import * as Profile from './components/Profile.js';
20
20
  export { Profile };
21
21
  export { SideNavSlot } from './components/SideNavSlot.js';
22
+ export { SideNavTitle } from './components/SideNavTitle.js';
@@ -334,7 +334,7 @@ const SideNavMenu = /*#__PURE__*/React__default.forwardRef(function SideNavMenu(
334
334
  ref: menuRef,
335
335
  type: "button",
336
336
  tabIndex: isTreeview ? -1 : 0
337
- }, IconElement && /*#__PURE__*/React__default.createElement(react.SideNavIcon, null, /*#__PURE__*/React__default.createElement(IconElement, null)), !sideNavExpanded && /*#__PURE__*/React__default.createElement("div", {
337
+ }, IconElement && /*#__PURE__*/React__default.createElement(react.SideNavIcon, null, /*#__PURE__*/React__default.createElement(IconElement, null)), !sideNavExpanded && navType == SideNav.SIDE_NAV_TYPE.PANEL && /*#__PURE__*/React__default.createElement("div", {
338
338
  className: `${prefix}--side-nav--panel-submenu-caret-container`
339
339
  }, /*#__PURE__*/React__default.createElement("div", {
340
340
  className: `${prefix}--side-nav--panel-submenu-caret`
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ export interface SideNavTitleProps {
9
+ /**
10
+ * Provide the contents of the SideNavTitle.
11
+ */
12
+ children?: React.ReactNode;
13
+ /**
14
+ * Provide an optional class to be applied to the containing node
15
+ */
16
+ className?: string;
17
+ }
18
+ export declare const SideNavTitle: React.FC<SideNavTitleProps>;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ var cx = require('classnames');
11
+ var PropTypes = require('prop-types');
12
+ var React__default = require('react');
13
+ var usePrefix = require('../internal/usePrefix.js');
14
+ var react = require('@carbon/react');
15
+
16
+ var _SideNavDivider;
17
+ const SideNavTitle = ({
18
+ children,
19
+ className: customClassName
20
+ }) => {
21
+ const prefix = usePrefix.usePrefix();
22
+ const className = cx(`${prefix}--side-nav__title`, customClassName);
23
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("li", {
24
+ className: className
25
+ }, children), _SideNavDivider || (_SideNavDivider = /*#__PURE__*/React__default.createElement(react.SideNavDivider, null)));
26
+ };
27
+ SideNavTitle.propTypes = {
28
+ /**
29
+ * Provide the contents of the SideNavTitle.
30
+ */
31
+ children: PropTypes.node,
32
+ /**
33
+ * Provide an optional class to be applied to the containing node
34
+ */
35
+ className: PropTypes.string
36
+ };
37
+
38
+ exports.SideNavTitle = SideNavTitle;
package/lib/index.d.ts CHANGED
@@ -19,3 +19,4 @@ export { HeaderDivider } from './components/HeaderDivider';
19
19
  export { TrialCountdown } from './components/TrialCountdown';
20
20
  export * as Profile from './components/Profile';
21
21
  export { SideNavSlot } from './components/SideNavSlot';
22
+ export { SideNavTitle } from './components/SideNavTitle';
package/lib/index.js CHANGED
@@ -20,6 +20,7 @@ var HeaderDivider = require('./components/HeaderDivider.js');
20
20
  var TrialCountdown = require('./components/TrialCountdown.js');
21
21
  var Profile = require('./components/Profile.js');
22
22
  var SideNavSlot = require('./components/SideNavSlot.js');
23
+ var SideNavTitle = require('./components/SideNavTitle.js');
23
24
 
24
25
 
25
26
 
@@ -40,3 +41,4 @@ exports.HeaderDivider = HeaderDivider.HeaderDivider;
40
41
  exports.TrialCountdown = TrialCountdown.TrialCountdown;
41
42
  exports.Profile = Profile;
42
43
  exports.SideNavSlot = SideNavSlot.SideNavSlot;
44
+ exports.SideNavTitle = SideNavTitle.SideNavTitle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon-labs/react-ui-shell",
3
- "version": "0.68.0",
3
+ "version": "0.70.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -42,5 +42,5 @@
42
42
  "dependencies": {
43
43
  "@ibm/telemetry-js": "^1.9.1"
44
44
  },
45
- "gitHead": "d3da5ef4a94c2af71e3c06af5104b0b726473351"
45
+ "gitHead": "7ee50abce7452bb5bc94f5de474ffb7f72a0f234"
46
46
  }
@@ -16,7 +16,7 @@ $prefix: 'cds' !default;
16
16
  .#{$prefix}--side-nav--panel ~ .#{$prefix}--content,
17
17
  div:has(.#{$prefix}--side-nav--panel) ~ .#{$prefix}--content {
18
18
  margin-inline-start: $spacing-09;
19
- transition: margin-inline-start $duration-fast-02, transform $duration-fast-02;
19
+ transition: $fast-02 motion(exit, productive);
20
20
  }
21
21
 
22
22
  .#{$prefix}--side-nav--panel.#{$prefix}--side-nav--expanded
@@ -24,6 +24,8 @@ div:has(.#{$prefix}--side-nav--panel) ~ .#{$prefix}--content {
24
24
  div:has(.#{$prefix}--side-nav--panel.#{$prefix}--side-nav--expanded)
25
25
  ~ .#{$prefix}--content {
26
26
  margin-inline-start: convert.to-rem(256px);
27
+ transition: $moderate-01 motion(standard, productive);
28
+ transition-delay: 40ms;
27
29
  }
28
30
 
29
31
  // should not be a grid influencer when used with overlay
@@ -29,7 +29,17 @@ div:has(.#{$prefix}--header)
29
29
  }
30
30
 
31
31
  .#{$prefix}--side-nav {
32
+ z-index: z('header') - 1;
32
33
  overflow: visible;
34
+
35
+ // closing side-nav transition
36
+ transition: $fast-02 motion(exit, productive);
37
+ }
38
+
39
+ .#{$prefix}--side-nav.#{$prefix}--side-nav--expanded {
40
+ // opening side-nav transition
41
+ transition: $moderate-01 motion(standard, productive);
42
+ transition-delay: 40ms;
33
43
  }
34
44
 
35
45
  //----------------------------------------------------------------------------
@@ -129,6 +139,21 @@ div:has(.#{$prefix}--header)
129
139
  }
130
140
  }
131
141
 
142
+ // SideNavTitle
143
+ .#{$prefix}--side-nav__title {
144
+ @include type-style('label-01');
145
+
146
+ display: none;
147
+ color: $text-secondary;
148
+ padding-block-start: $spacing-05;
149
+ padding-inline-start: $spacing-05;
150
+ white-space: nowrap;
151
+ }
152
+
153
+ .#{$prefix}--side-nav--expanded .#{$prefix}--side-nav__title {
154
+ display: block;
155
+ }
156
+
132
157
  // SideNavMenu
133
158
  // Level 2 / Doublewide Level 3
134
159
  // without icon
@@ -302,22 +327,25 @@ div:has(.#{$prefix}--header)
302
327
  inset-block-start: 0;
303
328
  inset-inline-start: 100%;
304
329
  transform: translateX(-100%);
305
- transition: color $duration-fast-02, background-color $duration-fast-02,
306
- outline $duration-fast-02;
330
+ transition: $fast-02 motion(exit, productive);
307
331
  will-change: inline-size;
308
332
  }
309
333
 
310
334
  .#{$prefix}--side-nav__menu-secondary-wrapper-expanded {
335
+ box-shadow: $spacing-02 0 convert.to-rem(6px) convert.to-rem(-3px) $shadow;
336
+
311
337
  inline-size: 16rem;
312
338
  overflow-y: auto;
313
339
  transform: translateX(0);
340
+ transition: $moderate-01 motion(standard, productive);
341
+ transition-delay: 40ms;
314
342
  }
315
343
 
316
344
  //----------------------------------------------------------------------------
317
345
  // Panel
318
346
  //----------------------------------------------------------------------------
319
347
  .#{$prefix}--side-nav--panel {
320
- z-index: 7999; /* needs to be below header */
348
+ z-index: z('header') - 2;
321
349
  overflow: visible;
322
350
  border-inline-end: 1px solid $border-subtle;
323
351
 
@@ -554,10 +582,15 @@ div:has(.#{$prefix}--header)
554
582
  // Rail
555
583
  //----------------------------------------------------------------------------
556
584
  .#{$prefix}--side-nav--rail {
557
- z-index: 7999; /* needs to be below header */
585
+ z-index: z('header') - 2;
558
586
  border-inline-end: 1px solid $border-subtle;
559
587
  }
560
588
 
589
+ .#{$prefix}--side-nav--rail.#{$prefix}--side-nav--expanded {
590
+ border-inline-end: none;
591
+ box-shadow: $spacing-02 0 convert.to-rem(6px) convert.to-rem(-3px) $shadow;
592
+ }
593
+
561
594
  @each $breakpoint in ('sm', 'md', 'lg', 'xlg', 'max') {
562
595
  .#{$prefix}--side-nav--rail.#{$prefix}--side-nav--hide-rail-breakpoint-down-#{$breakpoint} {
563
596
  @include breakpoint-down($breakpoint) {
@@ -568,13 +601,9 @@ div:has(.#{$prefix}--header)
568
601
 
569
602
  // allow overlay to display at all breakpoints
570
603
  .#{$prefix}--side-nav__overlay-active {
571
- z-index: z('overlay');
572
- background-color: $overlay;
604
+ background-color: transparent;
573
605
  block-size: 100vh;
574
606
  inline-size: 100vw;
575
- opacity: 1;
576
- transition: opacity $transition-expansion $standard-easing,
577
- background-color $transition-expansion $standard-easing;
578
607
  }
579
608
 
580
609
  //----------------------------------------------------------------------------