@carbon-labs/react-ui-shell 0.56.0 → 0.58.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.
@@ -42,8 +42,8 @@ function _objectWithoutProperties(e, t) {
42
42
  r,
43
43
  i = _objectWithoutPropertiesLoose(e, t);
44
44
  if (Object.getOwnPropertySymbols) {
45
- var s = Object.getOwnPropertySymbols(e);
46
- for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
45
+ var n = Object.getOwnPropertySymbols(e);
46
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
47
47
  }
48
48
  return i;
49
49
  }
@@ -51,7 +51,7 @@ function _objectWithoutPropertiesLoose(r, e) {
51
51
  if (null == r) return {};
52
52
  var t = {};
53
53
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
54
- if (e.includes(n)) continue;
54
+ if (-1 !== e.indexOf(n)) continue;
55
55
  t[n] = r[n];
56
56
  }
57
57
  return t;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon-labs/react-ui-shell",
3
- "version": "0.56.0",
3
+ "version": "0.58.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": "b6e3f1eee062300399bfeb201ff5254bce2eb573"
45
+ "gitHead": "d0cbc0ae2d4ee86c3a28429fb07a0896e91506bf"
46
46
  }
@@ -22,11 +22,15 @@ $prefix: 'cds' !default;
22
22
  }
23
23
 
24
24
  .#{$prefix}--header__action:focus {
25
- box-shadow: inset 0 0 0 1px $focus, inset 0 0 0 2px $background;
25
+ outline-offset: -2px;
26
26
  }
27
27
 
28
28
  .#{$prefix}--header-action__button {
29
29
  block-size: convert.rem(48px);
30
+
31
+ &:focus {
32
+ outline-offset: -2px;
33
+ }
30
34
  }
31
35
 
32
36
  .#{$prefix}--header-action__button.#{$prefix}--btn--ghost:not([disabled]) svg {
@@ -41,11 +45,6 @@ $prefix: 'cds' !default;
41
45
  fill: $icon-primary;
42
46
  }
43
47
 
44
- // TODO: remove when https://github.com/carbon-design-system/carbon/pull/18725 is released
45
- .#{$prefix}--header-action .#{$prefix}--tooltip-content {
46
- color: $text-primary;
47
- }
48
-
49
48
  .#{$prefix}--header-action.#{$prefix}--popover--open
50
49
  .#{$prefix}--header-action__button {
51
50
  background-color: $layer;
@@ -63,12 +62,6 @@ $prefix: 'cds' !default;
63
62
  $link-visited
64
63
  );
65
64
  @include custom-property.declaration('link-focus-text-color', $focus);
66
-
67
- padding: 0;
68
-
69
- > * {
70
- padding: 0 $spacing-05 $spacing-05 $spacing-05;
71
- }
72
65
  }
73
66
 
74
67
  //----------------------------------------------------------------------------
@@ -14,16 +14,30 @@
14
14
 
15
15
  $prefix: 'cds' !default;
16
16
 
17
- // user-info
18
- .#{$prefix}--header-action .#{$prefix}--profile-user-info {
19
- display: flex;
20
- padding-block-start: $spacing-05;
17
+ // profile
18
+ .#{$prefix}--profile.#{$prefix}--popover--open {
19
+ background-color: $background;
20
+ }
21
21
 
22
- &:not(:last-child) {
22
+ .#{$prefix}--profile .#{$prefix}--toggletip-content {
23
+ padding: 0;
24
+ background-color: $background;
25
+ border-inline-start: 1px solid $border-subtle;
26
+ gap: 0;
27
+ max-block-size: 100vh;
28
+ overflow-y: scroll;
29
+
30
+ > * {
31
+ padding: $spacing-05;
23
32
  border-block-end: convert.to-rem(1px) solid $border-subtle;
24
33
  }
25
34
  }
26
35
 
36
+ // user-info
37
+ .#{$prefix}--profile .#{$prefix}--profile-user-info {
38
+ display: flex;
39
+ }
40
+
27
41
  .#{$prefix}--profile-user-info__text-wrapper {
28
42
  margin-inline-start: $spacing-05;
29
43
  }
@@ -37,14 +51,6 @@ $prefix: 'cds' !default;
37
51
  }
38
52
 
39
53
  // read only
40
- .#{$prefix}--profile-read-only {
41
- padding-block-start: 0;
42
-
43
- &:not(:last-child) {
44
- border-block-end: convert.to-rem(1px) solid $border-subtle;
45
- }
46
- }
47
-
48
54
  .#{$prefix}--profile-read-only__items:not(:last-child) {
49
55
  padding-block-end: $spacing-05;
50
56
  }
@@ -65,10 +71,9 @@ $prefix: 'cds' !default;
65
71
  // contained-list links
66
72
  .#{$prefix}--header-action__content .#{$prefix}--contained-list--on-page {
67
73
  padding: 0;
68
- margin-block-start: -$spacing-05;
69
74
  }
70
75
 
71
- // TODO: remove if we make the contained-list header optional
76
+ // TODO: remove when https://github.com/carbon-design-system/carbon/pull/19813 is released
72
77
  .#{$prefix}--header-action__content .#{$prefix}--contained-list__header {
73
78
  display: none;
74
79
  }
@@ -1,35 +0,0 @@
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, { ReactNode } from 'react';
8
- export interface HeaderPanelProps {
9
- /**
10
- * Specify whether focus and blur listeners are added. They are by default.
11
- */
12
- addFocusListeners?: boolean;
13
- /**
14
- * The content that will render inside of the `HeaderPanel`
15
- */
16
- children?: ReactNode;
17
- /**
18
- * Optionally provide a custom class to apply to the underlying `<li>` node
19
- */
20
- className?: string;
21
- /**
22
- * Specify whether the panel is expanded
23
- */
24
- expanded?: boolean;
25
- /**
26
- * Provide the `href` to the id of the element on your package that could
27
- * be target.
28
- */
29
- href?: string;
30
- /**
31
- * An optional listener that is called a callback to collapse the HeaderPanel
32
- */
33
- onHeaderPanelFocus?: () => void;
34
- }
35
- export declare const HeaderPanel: React.FC<HeaderPanelProps>;
@@ -1,104 +0,0 @@
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 { extends as _extends } from '../_virtual/_rollupPluginBabelHelpers.js';
9
- import cx from '../_virtual/index.js';
10
- import PropTypes from 'prop-types';
11
- import React, { useRef, useState } from 'react';
12
- import { usePrefix } from '../internal/usePrefix.js';
13
- import { Escape } from '../internal/keyboard/keys.js';
14
- import { match } from '../internal/keyboard/match.js';
15
- import { useWindowEvent } from '../internal/useEvent.js';
16
- import { useMergedRefs } from '../internal/useMergedRefs.js';
17
-
18
- const noopFn = () => {};
19
- const HeaderPanel = /*#__PURE__*/React.forwardRef(function HeaderPanel(_ref, ref) {
20
- let {
21
- children,
22
- className: customClassName,
23
- expanded,
24
- addFocusListeners = true,
25
- onHeaderPanelFocus = noopFn,
26
- href,
27
- ...rest
28
- } = _ref;
29
- const prefix = usePrefix();
30
- const headerPanelReference = useRef(null);
31
- const headerPanelRef = useMergedRefs([headerPanelReference, ref]);
32
- const controlled = useRef(expanded !== undefined).current;
33
- const [expandedState, setExpandedState] = useState(expanded);
34
- const expandedProp = controlled ? expanded : expandedState;
35
- const [lastClickedElement, setLastClickedElement] = useState(null);
36
- const className = cx(`${prefix}--header-panel`, {
37
- [`${prefix}--header-panel--expanded`]: expandedProp,
38
- [customClassName]: !!customClassName
39
- });
40
- const eventHandlers = {};
41
- if (addFocusListeners) {
42
- eventHandlers.onBlur = event => {
43
- if (!event.currentTarget.contains(event.relatedTarget) && !lastClickedElement?.classList?.contains(`${prefix}--switcher__item-link`)) {
44
- setExpandedState(false);
45
- setLastClickedElement(null);
46
- if (expanded) {
47
- onHeaderPanelFocus();
48
- }
49
- }
50
- };
51
- eventHandlers.onKeyDown = event => {
52
- if (match(event, Escape)) {
53
- setExpandedState(false);
54
- onHeaderPanelFocus();
55
- if (href) {
56
- window.location.href = href;
57
- }
58
- }
59
- };
60
- }
61
- useWindowEvent('click', () => {
62
- const focusedElement = document.activeElement;
63
- setLastClickedElement(focusedElement);
64
- const childJsxElement = children;
65
- if (childJsxElement?.type?.displayName === 'Switcher' && !focusedElement?.closest(`.${prefix}--header-panel--expanded`) && !focusedElement?.closest(`.${prefix}--header__action`) && !headerPanelReference?.current?.classList.contains(`${prefix}--switcher`) && expanded) {
66
- setExpandedState(false);
67
- onHeaderPanelFocus();
68
- }
69
- });
70
- return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
71
- className: className,
72
- ref: headerPanelRef
73
- }, eventHandlers), children);
74
- });
75
- HeaderPanel.propTypes = {
76
- /**
77
- * Specify whether focus and blur listeners are added. They are by default.
78
- */
79
- addFocusListeners: PropTypes.bool,
80
- /**
81
- * The content that will render inside of the `HeaderPanel`
82
- */
83
- children: PropTypes.any,
84
- /**
85
- * Optionally provide a custom class to apply to the underlying `<li>` node
86
- */
87
- className: PropTypes.string,
88
- /**
89
- * Specify whether the panel is expanded
90
- */
91
- expanded: PropTypes.bool,
92
- /**
93
- * Provide the `href` to the id of the element on your package that could
94
- * be target.
95
- */
96
- href: PropTypes.string,
97
- /**
98
- * An optional listener that is called a callback to collapse the HeaderPanel
99
- */
100
- onHeaderPanelFocus: PropTypes.func
101
- };
102
- HeaderPanel.displayName = 'HeaderPanel';
103
-
104
- export { HeaderPanel };
@@ -1,35 +0,0 @@
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, { ReactNode } from 'react';
8
- export interface HeaderPanelProps {
9
- /**
10
- * Specify whether focus and blur listeners are added. They are by default.
11
- */
12
- addFocusListeners?: boolean;
13
- /**
14
- * The content that will render inside of the `HeaderPanel`
15
- */
16
- children?: ReactNode;
17
- /**
18
- * Optionally provide a custom class to apply to the underlying `<li>` node
19
- */
20
- className?: string;
21
- /**
22
- * Specify whether the panel is expanded
23
- */
24
- expanded?: boolean;
25
- /**
26
- * Provide the `href` to the id of the element on your package that could
27
- * be target.
28
- */
29
- href?: string;
30
- /**
31
- * An optional listener that is called a callback to collapse the HeaderPanel
32
- */
33
- onHeaderPanelFocus?: () => void;
34
- }
35
- export declare const HeaderPanel: React.FC<HeaderPanelProps>;
@@ -1,106 +0,0 @@
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 _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
11
- var index = require('../_virtual/index.js');
12
- var PropTypes = require('prop-types');
13
- var React = require('react');
14
- var usePrefix = require('../internal/usePrefix.js');
15
- var keys = require('../internal/keyboard/keys.js');
16
- var match = require('../internal/keyboard/match.js');
17
- var useEvent = require('../internal/useEvent.js');
18
- var useMergedRefs = require('../internal/useMergedRefs.js');
19
-
20
- const noopFn = () => {};
21
- const HeaderPanel = /*#__PURE__*/React.forwardRef(function HeaderPanel(_ref, ref) {
22
- let {
23
- children,
24
- className: customClassName,
25
- expanded,
26
- addFocusListeners = true,
27
- onHeaderPanelFocus = noopFn,
28
- href,
29
- ...rest
30
- } = _ref;
31
- const prefix = usePrefix.usePrefix();
32
- const headerPanelReference = React.useRef(null);
33
- const headerPanelRef = useMergedRefs.useMergedRefs([headerPanelReference, ref]);
34
- const controlled = React.useRef(expanded !== undefined).current;
35
- const [expandedState, setExpandedState] = React.useState(expanded);
36
- const expandedProp = controlled ? expanded : expandedState;
37
- const [lastClickedElement, setLastClickedElement] = React.useState(null);
38
- const className = index.default(`${prefix}--header-panel`, {
39
- [`${prefix}--header-panel--expanded`]: expandedProp,
40
- [customClassName]: !!customClassName
41
- });
42
- const eventHandlers = {};
43
- if (addFocusListeners) {
44
- eventHandlers.onBlur = event => {
45
- if (!event.currentTarget.contains(event.relatedTarget) && !lastClickedElement?.classList?.contains(`${prefix}--switcher__item-link`)) {
46
- setExpandedState(false);
47
- setLastClickedElement(null);
48
- if (expanded) {
49
- onHeaderPanelFocus();
50
- }
51
- }
52
- };
53
- eventHandlers.onKeyDown = event => {
54
- if (match.match(event, keys.Escape)) {
55
- setExpandedState(false);
56
- onHeaderPanelFocus();
57
- if (href) {
58
- window.location.href = href;
59
- }
60
- }
61
- };
62
- }
63
- useEvent.useWindowEvent('click', () => {
64
- const focusedElement = document.activeElement;
65
- setLastClickedElement(focusedElement);
66
- const childJsxElement = children;
67
- if (childJsxElement?.type?.displayName === 'Switcher' && !focusedElement?.closest(`.${prefix}--header-panel--expanded`) && !focusedElement?.closest(`.${prefix}--header__action`) && !headerPanelReference?.current?.classList.contains(`${prefix}--switcher`) && expanded) {
68
- setExpandedState(false);
69
- onHeaderPanelFocus();
70
- }
71
- });
72
- return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, {
73
- className: className,
74
- ref: headerPanelRef
75
- }, eventHandlers), children);
76
- });
77
- HeaderPanel.propTypes = {
78
- /**
79
- * Specify whether focus and blur listeners are added. They are by default.
80
- */
81
- addFocusListeners: PropTypes.bool,
82
- /**
83
- * The content that will render inside of the `HeaderPanel`
84
- */
85
- children: PropTypes.any,
86
- /**
87
- * Optionally provide a custom class to apply to the underlying `<li>` node
88
- */
89
- className: PropTypes.string,
90
- /**
91
- * Specify whether the panel is expanded
92
- */
93
- expanded: PropTypes.bool,
94
- /**
95
- * Provide the `href` to the id of the element on your package that could
96
- * be target.
97
- */
98
- href: PropTypes.string,
99
- /**
100
- * An optional listener that is called a callback to collapse the HeaderPanel
101
- */
102
- onHeaderPanelFocus: PropTypes.func
103
- };
104
- HeaderPanel.displayName = 'HeaderPanel';
105
-
106
- exports.HeaderPanel = HeaderPanel;