@carbon-labs/react-ui-shell 0.83.0 → 0.85.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.
@@ -461,88 +461,74 @@ SideNav.propTypes = {
461
461
  */
462
462
  addMouseListeners: PropTypes.bool,
463
463
  /**
464
- * Optionally provide a custom class to apply to the underlying `<li>` node
464
+ * Optionally provide a custom class to apply to the `<nav>` element
465
465
  */
466
466
  className: PropTypes.string,
467
467
  /**
468
- * If `true`, the SideNav will be open on initial render.
468
+ * Specify whether the `SideNav` starts expanded when initially rendered. Only applies when using the `SideNav` as an uncontrolled component.
469
469
  */
470
470
  defaultExpanded: PropTypes.bool,
471
471
  /**
472
- * Specify the duration in milliseconds to delay before displaying the sidenavigation
472
+ * Specify the duration in milliseconds to delay before displaying the `SideNav`.
473
473
  */
474
474
  enterDelayMs: PropTypes.number,
475
475
  /**
476
- * If `true`, the SideNav will be expanded, otherwise it will be collapsed.
477
- * Using this prop causes SideNav to become a controled component.
476
+ * Control the expanded state of the `SideNav` externally. When provided, the `SideNav` becomes a controlled component and you must handle toggle events.
478
477
  */
479
478
  expanded: PropTypes.bool,
480
479
  /**
481
- * If `true`, it means the SideNav is being used inside the HeaderOverflowPanel component for sm/md breakpoints.
480
+ * Specify whether the `SideNav` is rendered inside a `HeaderOverflowPanel`. When `true`, adjusts the responsive behavior to work correctly within the overflow menu at mobile/tablet breakpoints.
482
481
  */
483
482
  headerOverflowPanel: PropTypes.bool,
484
483
  /**
485
- * If `true`, the overlay will be hidden. Defaults to `false`.
484
+ * If `true`, the backdrop overlay will be hidden at all breakpoints. By default, the overlay appears behind the `SideNav` on mobile and tablet (below `lg` breakpoint).
486
485
  */
487
486
  hideOverlay: PropTypes.bool,
488
487
  /**
489
- * Specify the breakpoint at which the SideNav will be hidden.
490
- * Can be one of `sm`, `md`, `lg`, `xlg`, or `max`.
491
- * Only applies when `isRail` is `true`.
488
+ * Specify the breakpoint at which the `SideNav` will be hidden. Can be one of `sm`, `md`, `lg`, `xlg`, or `max`. Only applies when `isRail` is `true` or `navType` is `RAIL_PANEL`.
492
489
  */
493
490
  hideRailBreakpointDown: PropTypes.oneOf(['sm', 'md', 'lg', 'xlg', 'max']),
494
491
  /**
495
- * Provide the `href` to the id of the element on your package that is the
496
- * main content.
492
+ * Provide an `href` (typically an anchor like `#main-content`) to move focus to when closing the `SideNav` with the Escape key.
497
493
  */
498
494
  href: PropTypes.string,
499
495
  /**
500
- * Optionally provide a custom class to apply to the underlying `<li>` node
496
+ * Specify whether the `SideNav` is the primary navigation controlled by the header. When `true`, the `SideNav` is part of the UI Shell header layout (full-width on desktop, collapses on mobile). Set to `false` for secondary navigation / rails, overflow panels, or standalone navigation that is independent of the header.
501
497
  */
502
498
  isChildOfHeader: PropTypes.bool,
503
499
  /**
504
- * Specify whether the SideNav is collapsible at desktop
500
+ * Specify whether the `SideNav` can be toggled open/closed on desktop. When `true`, the `SideNav` starts collapsed and users can expand it. Requires `isChildOfHeader` to be `true` (default).
505
501
  */
506
502
  isCollapsible: PropTypes.bool,
507
503
  /**
508
- * Specify if sideNav is standalone
504
+ * Specify if `SideNav` is standalone.
509
505
  */
510
506
  isFixedNav: PropTypes.bool,
511
507
  /**
512
- * Specify if the sideNav will be persistent above the lg breakpoint
508
+ * Specify whether the `SideNav` is visible by default. When `false`, applies the hidden class which sets width to 0.
513
509
  */
514
510
  isPersistent: PropTypes.bool,
515
511
  /**
516
- * Optional prop to display the side nav rail.
512
+ * Specify whether to display the `SideNav` rail variant. When `true`, the `SideNav` displays as a narrow rail (48px) that expands to full-width on hover.
517
513
  */
518
514
  isRail: PropTypes.bool,
519
515
  /**
520
- * An optional listener that is called when the SideNav overlay is clicked
516
+ * An optional listener that is called when the `SideNav` overlay is clicked.
521
517
  *
522
518
  * @param {object} event
523
519
  */
524
520
  onOverlayClick: PropTypes.func,
525
521
  /**
526
- * An optional listener that is called a callback to collapse the SideNav
522
+ * An optional listener that is called as a callback to collapse the `SideNav`.
527
523
  */
528
-
529
524
  onSideNavBlur: PropTypes.func,
530
525
  /**
531
- * An optional listener that is called when an event that would cause
532
- * toggling the SideNav occurs.
526
+ * An optional listener that is called when an event that would cause toggling the `SideNav` occurs.
533
527
  *
534
528
  * @param {object} event
535
529
  * @param {boolean} value
536
530
  */
537
531
  onToggle: PropTypes.func
538
-
539
- /**
540
- * Provide a custom function for translating all message ids within this
541
- * component. This function will take in two arguments: the mesasge Id and the
542
- * state of the component. From this, you should return a string representing
543
- * the label you want displayed or read by screen readers.
544
- */
545
- // translateById: PropTypes.func,
546
532
  };
547
533
 
548
534
  export { SIDE_NAV_TYPE, SideNav, SideNavContext, translationIds };
@@ -463,88 +463,74 @@ SideNav.propTypes = {
463
463
  */
464
464
  addMouseListeners: PropTypes.bool,
465
465
  /**
466
- * Optionally provide a custom class to apply to the underlying `<li>` node
466
+ * Optionally provide a custom class to apply to the `<nav>` element
467
467
  */
468
468
  className: PropTypes.string,
469
469
  /**
470
- * If `true`, the SideNav will be open on initial render.
470
+ * Specify whether the `SideNav` starts expanded when initially rendered. Only applies when using the `SideNav` as an uncontrolled component.
471
471
  */
472
472
  defaultExpanded: PropTypes.bool,
473
473
  /**
474
- * Specify the duration in milliseconds to delay before displaying the sidenavigation
474
+ * Specify the duration in milliseconds to delay before displaying the `SideNav`.
475
475
  */
476
476
  enterDelayMs: PropTypes.number,
477
477
  /**
478
- * If `true`, the SideNav will be expanded, otherwise it will be collapsed.
479
- * Using this prop causes SideNav to become a controled component.
478
+ * Control the expanded state of the `SideNav` externally. When provided, the `SideNav` becomes a controlled component and you must handle toggle events.
480
479
  */
481
480
  expanded: PropTypes.bool,
482
481
  /**
483
- * If `true`, it means the SideNav is being used inside the HeaderOverflowPanel component for sm/md breakpoints.
482
+ * Specify whether the `SideNav` is rendered inside a `HeaderOverflowPanel`. When `true`, adjusts the responsive behavior to work correctly within the overflow menu at mobile/tablet breakpoints.
484
483
  */
485
484
  headerOverflowPanel: PropTypes.bool,
486
485
  /**
487
- * If `true`, the overlay will be hidden. Defaults to `false`.
486
+ * If `true`, the backdrop overlay will be hidden at all breakpoints. By default, the overlay appears behind the `SideNav` on mobile and tablet (below `lg` breakpoint).
488
487
  */
489
488
  hideOverlay: PropTypes.bool,
490
489
  /**
491
- * Specify the breakpoint at which the SideNav will be hidden.
492
- * Can be one of `sm`, `md`, `lg`, `xlg`, or `max`.
493
- * Only applies when `isRail` is `true`.
490
+ * Specify the breakpoint at which the `SideNav` will be hidden. Can be one of `sm`, `md`, `lg`, `xlg`, or `max`. Only applies when `isRail` is `true` or `navType` is `RAIL_PANEL`.
494
491
  */
495
492
  hideRailBreakpointDown: PropTypes.oneOf(['sm', 'md', 'lg', 'xlg', 'max']),
496
493
  /**
497
- * Provide the `href` to the id of the element on your package that is the
498
- * main content.
494
+ * Provide an `href` (typically an anchor like `#main-content`) to move focus to when closing the `SideNav` with the Escape key.
499
495
  */
500
496
  href: PropTypes.string,
501
497
  /**
502
- * Optionally provide a custom class to apply to the underlying `<li>` node
498
+ * Specify whether the `SideNav` is the primary navigation controlled by the header. When `true`, the `SideNav` is part of the UI Shell header layout (full-width on desktop, collapses on mobile). Set to `false` for secondary navigation / rails, overflow panels, or standalone navigation that is independent of the header.
503
499
  */
504
500
  isChildOfHeader: PropTypes.bool,
505
501
  /**
506
- * Specify whether the SideNav is collapsible at desktop
502
+ * Specify whether the `SideNav` can be toggled open/closed on desktop. When `true`, the `SideNav` starts collapsed and users can expand it. Requires `isChildOfHeader` to be `true` (default).
507
503
  */
508
504
  isCollapsible: PropTypes.bool,
509
505
  /**
510
- * Specify if sideNav is standalone
506
+ * Specify if `SideNav` is standalone.
511
507
  */
512
508
  isFixedNav: PropTypes.bool,
513
509
  /**
514
- * Specify if the sideNav will be persistent above the lg breakpoint
510
+ * Specify whether the `SideNav` is visible by default. When `false`, applies the hidden class which sets width to 0.
515
511
  */
516
512
  isPersistent: PropTypes.bool,
517
513
  /**
518
- * Optional prop to display the side nav rail.
514
+ * Specify whether to display the `SideNav` rail variant. When `true`, the `SideNav` displays as a narrow rail (48px) that expands to full-width on hover.
519
515
  */
520
516
  isRail: PropTypes.bool,
521
517
  /**
522
- * An optional listener that is called when the SideNav overlay is clicked
518
+ * An optional listener that is called when the `SideNav` overlay is clicked.
523
519
  *
524
520
  * @param {object} event
525
521
  */
526
522
  onOverlayClick: PropTypes.func,
527
523
  /**
528
- * An optional listener that is called a callback to collapse the SideNav
524
+ * An optional listener that is called as a callback to collapse the `SideNav`.
529
525
  */
530
-
531
526
  onSideNavBlur: PropTypes.func,
532
527
  /**
533
- * An optional listener that is called when an event that would cause
534
- * toggling the SideNav occurs.
528
+ * An optional listener that is called when an event that would cause toggling the `SideNav` occurs.
535
529
  *
536
530
  * @param {object} event
537
531
  * @param {boolean} value
538
532
  */
539
533
  onToggle: PropTypes.func
540
-
541
- /**
542
- * Provide a custom function for translating all message ids within this
543
- * component. This function will take in two arguments: the mesasge Id and the
544
- * state of the component. From this, you should return a string representing
545
- * the label you want displayed or read by screen readers.
546
- */
547
- // translateById: PropTypes.func,
548
534
  };
549
535
 
550
536
  exports.SIDE_NAV_TYPE = SIDE_NAV_TYPE;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon-labs/react-ui-shell",
3
- "version": "0.83.0",
3
+ "version": "0.85.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.10.2"
44
44
  },
45
- "gitHead": "36230cbb98ea772697697bc648577fdd06970002"
45
+ "gitHead": "e07b9ac0be185323c42826941d40632329004ee3"
46
46
  }