@carbon-labs/react-ui-shell 0.83.0 → 0.84.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/es/components/SideNav.js +16 -30
- package/lib/components/SideNav.js +16 -30
- package/package.json +2 -2
package/es/components/SideNav.js
CHANGED
|
@@ -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
|
|
464
|
+
* Optionally provide a custom class to apply to the `<nav>` element
|
|
465
465
|
*/
|
|
466
466
|
className: PropTypes.string,
|
|
467
467
|
/**
|
|
468
|
-
*
|
|
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
|
|
472
|
+
* Specify the duration in milliseconds to delay before displaying the `SideNav`.
|
|
473
473
|
*/
|
|
474
474
|
enterDelayMs: PropTypes.number,
|
|
475
475
|
/**
|
|
476
|
-
*
|
|
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
|
-
*
|
|
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.
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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
|
|
504
|
+
* Specify if `SideNav` is standalone.
|
|
509
505
|
*/
|
|
510
506
|
isFixedNav: PropTypes.bool,
|
|
511
507
|
/**
|
|
512
|
-
* Specify
|
|
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
|
-
*
|
|
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
|
|
466
|
+
* Optionally provide a custom class to apply to the `<nav>` element
|
|
467
467
|
*/
|
|
468
468
|
className: PropTypes.string,
|
|
469
469
|
/**
|
|
470
|
-
*
|
|
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
|
|
474
|
+
* Specify the duration in milliseconds to delay before displaying the `SideNav`.
|
|
475
475
|
*/
|
|
476
476
|
enterDelayMs: PropTypes.number,
|
|
477
477
|
/**
|
|
478
|
-
*
|
|
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
|
-
*
|
|
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.
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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
|
|
506
|
+
* Specify if `SideNav` is standalone.
|
|
511
507
|
*/
|
|
512
508
|
isFixedNav: PropTypes.bool,
|
|
513
509
|
/**
|
|
514
|
-
* Specify
|
|
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
|
-
*
|
|
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.
|
|
3
|
+
"version": "0.84.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": "
|
|
45
|
+
"gitHead": "a0eaa1502bff6b7ee998a43d67e260a4ede0e2eb"
|
|
46
46
|
}
|